Merge pull request #41816 from nextcloud/fix/dav/single-day-ooo

fix(dav): Allow single-day out of office
pull/41785/head
Christoph Wurst 6 months ago committed by GitHub
commit f8125cbdfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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: {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save