This commit is contained in:
Andras Schmelczer 2026-05-11 21:38:26 +01:00
parent 9248e26af2
commit f2a2651b8a
95 changed files with 3993 additions and 1471 deletions

View file

@ -89,25 +89,13 @@ export function formatDuration(d: string): string {
return d;
}
const MONTH_NAMES = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec',
];
export function formatTransactionDate(fractionalYear: number): string {
const year = Math.floor(fractionalYear);
const monthIndex = Math.min(Math.round((fractionalYear - year) * 12), 11);
return `${MONTH_NAMES[monthIndex]} ${year}`;
const language = i18n.language || undefined;
return new Intl.DateTimeFormat(language, { month: 'short', year: 'numeric' }).format(
new Date(Date.UTC(year, monthIndex, 1))
);
}
export function formatAge(value: number, approximate = true): string {