diff --git a/ui/src/components/loa/loaForm.vue b/ui/src/components/loa/loaForm.vue index 44eeb1c..c6f71c2 100644 --- a/ui/src/components/loa/loaForm.vue +++ b/ui/src/components/loa/loaForm.vue @@ -121,7 +121,7 @@ const minEndDate = computed(() => { if (values.start_date) { return new CalendarDate(values.start_date.getFullYear(), values.start_date.getMonth() + 1, values.start_date.getDate()) } else { - return null; + return today(getLocalTimeZone()); } }) @@ -134,6 +134,17 @@ 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); + let td = today(getLocalTimeZone()); + let start = new CalendarDate(endDateObj.getFullYear(), endDateObj.getMonth() + 1, endDateObj.getDate()) + return td.compare(start) > 0 ? td : start; + } else { + return today(getLocalTimeZone()); + } +}) + const memberFilter = ref(''); const filteredMembers = computed(() => { @@ -226,21 +237,31 @@ const filteredMembers = computed(() => { Start Date - - - +
+ + + + +
+ Select an LOA type first +
+
+ layout="month-and-year" + :min-value="minStartDate || today(getLocalTimeZone())" />
@@ -254,18 +275,28 @@ const filteredMembers = computed(() => { End Date - - - +
+ + + + +
+ Select an LOA type first +
+