fix minDate
This commit is contained in:
parent
86c6cc5236
commit
ba4239d87c
1 changed files with 9 additions and 0 deletions
|
|
@ -399,6 +399,14 @@ function changeCardID(citizenId: string | number | null) {
|
||||||
function calculateMaxDate() {
|
function calculateMaxDate() {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
today.setFullYear(today.getFullYear() - 18);
|
today.setFullYear(today.getFullYear() - 18);
|
||||||
|
|
||||||
|
return today;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** function เช็คอายุไม่เกิน 60 ปี*/
|
||||||
|
function calculateMinDate() {
|
||||||
|
const today = new Date();
|
||||||
|
today.setFullYear(today.getFullYear() - 60); // ลดปีลงไป 60 ปี
|
||||||
return today;
|
return today;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -655,6 +663,7 @@ onMounted(() => {
|
||||||
<datepicker
|
<datepicker
|
||||||
autoApply
|
autoApply
|
||||||
:max-date="calculateMaxDate()"
|
:max-date="calculateMaxDate()"
|
||||||
|
:min-date="calculateMinDate()"
|
||||||
borderless
|
borderless
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
week-start="0"
|
week-start="0"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue