From 0c069e480950ad3fabd8b789a7232a08c97bb39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Thu, 1 Dec 2022 21:14:58 +0800 Subject: [PATCH] fix: update date format when switching language --- composables/time.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composables/time.ts b/composables/time.ts index d0097033..ac6803dd 100644 --- a/composables/time.ts +++ b/composables/time.ts @@ -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)) : ''