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 {