diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-06-23 15:09:57 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-06-23 16:28:16 +0200 |
commit | 3a690b1cb59c31f37f91eea73e157c3bb26b6cef (patch) | |
tree | 9f987dea8ea1fa3b67db025815708d5998fa886d /apps/dav/lib/CalDAV/Calendar.php | |
parent | 35fe1dfebe976a7efdbaaa6344d08302b848b8a7 (diff) | |
download | nextcloud-server-3a690b1cb59c31f37f91eea73e157c3bb26b6cef.tar.gz nextcloud-server-3a690b1cb59c31f37f91eea73e157c3bb26b6cef.zip |
Use ISO8601 timestamps for the CalDAV trashbin
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav/lib/CalDAV/Calendar.php')
-rw-r--r-- | apps/dav/lib/CalDAV/Calendar.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php index df4d6d4a3fb..fa29fc8d588 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -28,6 +28,9 @@ */ namespace OCA\DAV\CalDAV; +use DateTimeImmutable; +use DateTimeInterface; +use OCA\DAV\CalDAV\Trashbin\Plugin as TrashbinPlugin; use OCA\DAV\DAV\Sharing\IShareable; use OCA\DAV\Exception\UnsupportedLimitOnInitialSyncException; use OCP\IConfig; @@ -63,6 +66,13 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IRestorable, IShareable * @param IConfig $config */ public function __construct(BackendInterface $caldavBackend, $calendarInfo, IL10N $l10n, IConfig $config) { + // Convert deletion date to ISO8601 string + if (isset($calendarInfo[TrashbinPlugin::PROPERTY_DELETED_AT])) { + $calendarInfo[TrashbinPlugin::PROPERTY_DELETED_AT] = (new DateTimeImmutable()) + ->setTimestamp($calendarInfo[TrashbinPlugin::PROPERTY_DELETED_AT]) + ->format(DateTimeInterface::ATOM); + } + parent::__construct($caldavBackend, $calendarInfo); if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI) { |