bugfix dashboard
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user