Added backwards restriction check if end date is selected first
This commit is contained in:
@@ -134,6 +134,15 @@ const maxEndDate = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const minStartDate = computed(() => {
|
||||
if (values.type && values.end_date) {
|
||||
let endDateObj = new Date(values.end_date.getTime() - values.type.max_length_days * 24 * 60 * 60 * 1000);
|
||||
return new CalendarDate(endDateObj.getFullYear(), endDateObj.getMonth() + 1, endDateObj.getDate())
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
|
||||
const memberFilter = ref('');
|
||||
|
||||
const filteredMembers = computed(() => {
|
||||
@@ -249,7 +258,7 @@ const filteredMembers = computed(() => {
|
||||
<PopoverContent class="w-auto p-0">
|
||||
<Calendar
|
||||
@update:model-value="(val: CalendarDate) => field.onChange(val.toDate(getLocalTimeZone()))"
|
||||
layout="month-and-year" :min-value="today(getLocalTimeZone())" />
|
||||
layout="month-and-year" :min-value="minStartDate || today(getLocalTimeZone())" />
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
<div class="h-4">
|
||||
|
||||
Reference in New Issue
Block a user