mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
fix(dav): Allow single-day out of office
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
e589232815
commit
84cfbe6b19
4 changed files with 11 additions and 5 deletions
|
|
@ -66,7 +66,7 @@ class AvailabilitySettingsController extends Controller {
|
|||
|
||||
$parsedFirstDay = new DateTimeImmutable($firstDay);
|
||||
$parsedLastDay = new DateTimeImmutable($lastDay);
|
||||
if ($parsedFirstDay->getTimestamp() >= $parsedLastDay->getTimestamp()) {
|
||||
if ($parsedFirstDay->getTimestamp() > $parsedLastDay->getTimestamp()) {
|
||||
throw new \Exception('First day is on or after last day');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
4
dist/dav-settings-personal-availability.js
vendored
4
dist/dav-settings-personal-availability.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue