fix: update date format when switching language

pull/274/head
三咲智子 2022-12-01 21:14:58 +08:00
rodzic e3ab850cc1
commit 0c069e4809
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 69992F2250DFD93E
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -5,7 +5,7 @@ export const useFormattedDateTime = (
options: Intl.DateTimeFormatOptions = { dateStyle: 'long', timeStyle: 'medium' },
) => {
const { locale } = useI18n()
const formatter = Intl.DateTimeFormat(locale.value, options)
const formatter = $computed(() => Intl.DateTimeFormat(locale.value, options))
return computed(() => {
const v = resolveUnref(value)
return v ? formatter.format(new Date(v)) : ''