0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-02-12 03:59:16 +00:00
nextcloud_server/apps/dav/lib/CalDAV/EventReaderRDate.php
provokateurin 9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +02:00

35 lines
673 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\CalDAV;
use DateTime;
class EventReaderRDate extends \Sabre\VObject\Recur\RDateIterator {
public function concludes(): ?DateTime {
return $this->concludesOn();
}
public function concludesAfter(): ?int {
return !empty($this->dates) ? count($this->dates) : null;
}
public function concludesOn(): ?DateTime {
if (count($this->dates) > 0) {
return new DateTime(
$this->dates[array_key_last($this->dates)],
$this->startDate->getTimezone()
);
}
return null;
}
}