From ed423cfaf79e695387f97c34b49d441710c2de26 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:57:50 +0700 Subject: [PATCH] refactor: prevent error --- src/utils/datetime.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/datetime.ts b/src/utils/datetime.ts index 098255c2..2053ea3f 100644 --- a/src/utils/datetime.ts +++ b/src/utils/datetime.ts @@ -1,7 +1,6 @@ import moment from 'moment'; import 'moment/dist/locale/th'; import 'moment/dist/locale/en-gb'; -import { useI18n } from 'vue-i18n'; import { i18n } from 'src/boot/i18n'; import { Lang } from './ui'; @@ -133,7 +132,7 @@ export function calculateAge( return only === 'year' ? years : only === 'months' ? months : days; } - const { locale } = useI18n(); + const { locale } = i18n.global; if (locale.value === 'tha') { return `${years} ปี ${months !== 0 ? months + ' เดือน' : ''} ${days !== 0 ? days + ' วัน' : ''} `; } else {