fix: handle input future birth date

This commit is contained in:
puriphatt 2024-07-16 08:23:54 +00:00
parent a92e9ffdc1
commit a716420de9

View file

@ -164,8 +164,9 @@ defineProps<{
@update:model-value="
(v) => {
if (v && v.toString().length === 10) {
const today = new Date();
const date = parseAndFormatDate(v);
birthDate = date;
birthDate = date && date > today ? today : date;
}
if (v && v.toString().length === 0) birthDate = '';
}