แก้ไขไม่ให้เลือกวันเกิน Date now

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-11-01 11:38:15 +07:00
parent d2db87cc2e
commit d2a50125a5
3 changed files with 354 additions and 161 deletions

View file

@ -8,6 +8,12 @@ const mixin = useCounterMixin();
const { date2Thai } = mixin;
const { filterFn, searchDataFn } = workStore;
function calculateMaxDate() {
const today = new Date();
today.setDate(today.getDate() - 1);
return today;
}
</script>
<template>
@ -20,6 +26,7 @@ const { filterFn, searchDataFn } = workStore;
autoApply
:enableTimePicker="false"
week-start="0"
:max-date="calculateMaxDate()"
@update:model-value="
searchDataFn(workStore.selectDate, workStore.selectStatus)
"