refactor: prevent error
This commit is contained in:
parent
ca38cfaec0
commit
ed423cfaf7
1 changed files with 1 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue