fix: input date only (birth date for now)
This commit is contained in:
parent
2d8c4d5d6a
commit
a92e9ffdc1
2 changed files with 36 additions and 2 deletions
|
|
@ -103,3 +103,13 @@ export function disabledAfterToday(date: Date) {
|
|||
today.setHours(0, 0, 0, 0);
|
||||
return date > today;
|
||||
}
|
||||
|
||||
export function parseAndFormatDate(value: string | number | undefined) {
|
||||
if (!value) return;
|
||||
if (value && value.toString().length === 10) {
|
||||
const [year, month, day] = value.toString().split('/');
|
||||
|
||||
return new Date(`${day}/${month}/${year}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue