fix: date picker input format
This commit is contained in:
parent
7caf0dfdd9
commit
30379bfe25
1 changed files with 2 additions and 3 deletions
|
|
@ -119,12 +119,11 @@ export function parseAndFormatDate(
|
||||||
|
|
||||||
if (value && value.toString().length === 10) {
|
if (value && value.toString().length === 10) {
|
||||||
const [date, month, year] = value.toString().split('/');
|
const [date, month, year] = value.toString().split('/');
|
||||||
|
|
||||||
if (locale === 'tha') {
|
if (locale === 'tha') {
|
||||||
const adjustedYear = Number(year) - 543;
|
const adjustedYear = Number(year) - 543;
|
||||||
return new Date(`${month}/${date}/${adjustedYear}T00:00.000Z`);
|
return new Date(`${adjustedYear}-${month}-${date}T00:00:00.000Z`);
|
||||||
} else {
|
} else {
|
||||||
return new Date(`${month}/${date}/${year}T00:00.000Z`);
|
return new Date(`${year}-${month}-${date}T00:00:00.000Z`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue