Merge refactor/i18n into develop

This commit is contained in:
Methapon Metanipat 2024-08-26 16:24:08 +07:00
parent 3da5bf9079
commit c681b19e39
99 changed files with 2192 additions and 2987 deletions

View file

@ -91,7 +91,7 @@ export function calculateAge(birthDate: Date | null | string) {
const months = ageDate.getUTCMonth();
const days = ageDate.getUTCDate() - 1;
if (locale.value === 'th-th') {
if (locale.value === 'tha') {
return `${years} ปี ${months !== 0 ? months + ' เดือน' : ''} ${days !== 0 ? days + ' วัน' : ''} `;
} else {
return `${years} years ${months !== 0 ? months + ' months' : ''} ${days !== 0 ? days + ' days' : ''} `;
@ -113,7 +113,7 @@ export function parseAndFormatDate(
if (value && value.toString().length === 10) {
const [date, month, year] = value.toString().split('/');
if (locale === 'th-th') {
if (locale === 'tha') {
const adjustedYear = Number(year) - 543;
return new Date(`${month}/${date}/${adjustedYear}T00:00.000Z`);
} else {