smartified start date restrictions to never go earlier than today
This commit is contained in:
@@ -137,7 +137,9 @@ 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())
|
||||
let td = today(getLocalTimeZone());
|
||||
let start = new CalendarDate(endDateObj.getFullYear(), endDateObj.getMonth() + 1, endDateObj.getDate())
|
||||
return td.compare(start) > 0 ? td : start;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -258,7 +260,8 @@ 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="minStartDate || today(getLocalTimeZone())" />
|
||||
layout="month-and-year"
|
||||
:min-value="minStartDate || today(getLocalTimeZone())" />
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
<div class="h-4">
|
||||
|
||||
Reference in New Issue
Block a user