bugfix dashboard

This commit is contained in:
Jordy Hoogeveen
2026-09-17 16:23:39 +02:00
parent 0b67f346e1
commit ad45e372e6
9 changed files with 158 additions and 48 deletions
+15
View File
@@ -14,6 +14,21 @@ export const fmtDatum = (s) => {
return `${d}-${m}-${y}`;
};
const MAANDEN = ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"];
/**
* ISO datum → korte maandnotatie (`2026-09-16` → `sep '26`).
*
* Voor de x-as van de grafieken: een volledige datum is tien tekens en past
* daar alleen gedraaid, wat bij een lange reeks onleesbaar wordt. De exacte
* dag staat in de tooltip.
*/
export const fmtMaand = (s) => {
if (!s) return s;
const [y, m] = s.split("-");
return `${MAANDEN[parseInt(m, 10) - 1] ?? m} '${y.slice(2)}`;
};
/** Crypto-bedrag formatter (4 decimalen standaard) */
export const fmtCrypto = (n, d = 4) => (parseFloat(n) || 0).toFixed(d);