<?php
+use Sabre\VObject;
+
/**
* PDO CalDAV backend
*
/**
* We need to specify a max date, because we need to stop *somewhere*
+ *
+ * On 32 bit system the maximum for a signed integer is 2147483647, so
+ * MAX_DATE cannot be higher than date('Y-m-d', 2147483647) which results
+ * in 2038-01-19 to avoid problems when the date is converted
+ * to a unix timestamp.
*/
- const MAX_DATE = '2040-01-01';
+ const MAX_DATE = '2038-01-01';
/**
* pdo
*/
protected function getDenormalizedData($calendarData) {
- $vObject = Sabre_VObject_Reader::read($calendarData);
+ $vObject = VObject\Reader::read($calendarData);
$componentType = null;
$component = null;
$firstOccurence = null;
$lastOccurence = $component->DTEND->getDateTime()->getTimeStamp();
} elseif (isset($component->DURATION)) {
$endDate = clone $component->DTSTART->getDateTime();
- $endDate->add(Sabre_VObject_DateTimeParser::parse($component->DURATION->value));
+ $endDate->add(VObject\DateTimeParser::parse($component->DURATION->value));
$lastOccurence = $endDate->getTimeStamp();
- } elseif ($component->DTSTART->getDateType()===Sabre_VObject_Property_DateTime::DATE) {
+ } elseif ($component->DTSTART->getDateType()===VObject\Property\DateTime::DATE) {
$endDate = clone $component->DTSTART->getDateTime();
$endDate->modify('+1 day');
$lastOccurence = $endDate->getTimeStamp();
$lastOccurence = $firstOccurence;
}
} else {
- $it = new Sabre_VObject_RecurrenceIterator($vObject, (string)$component->UID);
+ $it = new VObject\RecurrenceIterator($vObject, (string)$component->UID);
$maxDate = new DateTime(self::MAX_DATE);
if ($it->isInfinite()) {
$lastOccurence = $maxDate->getTimeStamp();