chore(profile): date formatting from utils

This commit is contained in:
2026-02-18 01:55:59 +01:00
parent 92c73b9ed9
commit f2c11bf2cf
2 changed files with 19 additions and 11 deletions
+6
View File
@@ -29,3 +29,9 @@ export function humanizeDuration(timestampMs: number, showSeconds = false) {
? t('journal.seconds', { value: duration.secondsTotal }, duration.secondsTotal)
: t('journal.minutes', { value: duration.minsTotal }, duration.minsTotal);
}
export function dateToLocaleString(date: Date, dateOptions: Intl.DateTimeFormatOptions) {
const { locale } = useI18n();
return date.toLocaleString(locale.value == 'pl' ? 'pl-PL' : 'en-GB', dateOptions);
}