diff options
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/src/components/AbsenceForm.vue | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/dav/src/components/AbsenceForm.vue b/apps/dav/src/components/AbsenceForm.vue index aedd7867e40..f43fb889b9e 100644 --- a/apps/dav/src/components/AbsenceForm.vue +++ b/apps/dav/src/components/AbsenceForm.vue @@ -90,11 +90,17 @@ export default { * @return {boolean} */ valid() { + // Translate the two date objects to midnight for an accurate comparison + const firstDay = new Date(this.firstDay?.getTime()) + const lastDay = new Date(this.lastDay?.getTime()) + firstDay?.setHours(0, 0, 0, 0) + lastDay?.setHours(0, 0, 0, 0) + return !!this.firstDay && !!this.lastDay && !!this.status && !!this.message - && this.lastDay > this.firstDay + && lastDay >= firstDay }, }, methods: { |