Skip to content

Commit

Permalink
Merge pull request #41703 from nextcloud/fix/dav/ooo-date-conversion
Browse files Browse the repository at this point in the history
fix(dav): Convert dates without tz drift
  • Loading branch information
ChristophWurst authored Nov 29, 2023
2 parents 6e3781b + f1a18bb commit e589232
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/Listener/OutOfOfficeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private function createVCalendarEvent(IOutOfOfficeData $data, ?string $timeZoneD
->setTime(0, 0);
$end = (new DateTimeImmutable())
->setTimestamp($data->getEndDate())
->modify('+ 2 days')
->modify('+ 1 days')
->setTime(0, 0);
$vCalendar = new VCalendar();
$vCalendar->add('VEVENT', [
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/src/utils/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
* @return {string} 'YYYY-MM-DD'
*/
export function formatDateAsYMD(date) {
const year = date.getUTCFullYear()
const month = (date.getUTCMonth() + 1).toString().padStart(2, '0')
const day = date.getUTCDate().toString().padStart(2, '0')
const year = date.getFullYear()
const month = (date.getMonth() + 1).toString().padStart(2, '0')
const day = date.getDate().toString().padStart(2, '0')
return `${year}-${month}-${day}`
}
4 changes: 2 additions & 2 deletions dist/dav-settings-personal-availability.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dav-settings-personal-availability.js.map

Large diffs are not rendered by default.

0 comments on commit e589232

Please sign in to comment.