mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
chore(profile): date formatting from utils
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user