diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2023-11-29 08:57:54 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2023-11-29 14:25:00 +0100 |
commit | 84cfbe6b1966943e7df04afc3d29ba8a3597cf4c (patch) | |
tree | cf564784bab88f10daeec244c8480b9d55971874 /apps/dav/src | |
parent | e589232815f5a89f25aa3bd963f307290bad82ba (diff) | |
download | nextcloud-server-84cfbe6b1966943e7df04afc3d29ba8a3597cf4c.tar.gz nextcloud-server-84cfbe6b1966943e7df04afc3d29ba8a3597cf4c.zip |
fix(dav): Allow single-day out of office
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav/src')
-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 500004b755a..6fb1c4ce1fd 100644 --- a/apps/dav/src/components/AbsenceForm.vue +++ b/apps/dav/src/components/AbsenceForm.vue @@ -89,11 +89,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: { |