}
}
+ $this->_handlevEventRecurrence($vEvent);
+
+ $this->initialized = true;
+ }
+
+ /**
+ * Handle parsing recurrence related fields.
+ *
+ * @param Horde_iCalendar $vEvent
+ */
+ protected function _handlevEventRecurrence($vEvent)
+ {
// Recurrence.
$rrule = $vEvent->getAttribute('RRULE');
if (!is_array($rrule) && !($rrule instanceof PEAR_Error)) {
$originaldt->format('d'));
$originalEvent->save();
}
-
- $this->initialized = true;
}
/**
return parent::getViewUrl($params, $full, $encoded);
}
+ /**
+ * Parses the various exception related fields. Only deal with the EXDATE
+ * field here.
+ *
+ * @param Horde_iCalendar $vEvent The vEvent part.
+ */
+ protected function _handlevEventRecurrence($vEvent)
+ {
+ // Recurrence.
+ $rrule = $vEvent->getAttribute('RRULE');
+ if (!is_array($rrule) && !($rrule instanceof PEAR_Error)) {
+ $this->recurrence = new Horde_Date_Recurrence($this->start);
+ if (strpos($rrule, '=') !== false) {
+ $this->recurrence->fromRRule20($rrule);
+ } else {
+ $this->recurrence->fromRRule10($rrule);
+ }
+
+ // Exceptions. EXDATE represents deleted events, just add the
+ // exception, no new event is needed.
+ $exdates = $vEvent->getAttributeValues('EXDATE');
+ if (is_array($exdates)) {
+ foreach ($exdates as $exdate) {
+ if (is_array($exdate)) {
+ $this->recurrence->addException((int)$exdate['year'],
+ (int)$exdate['month'],
+ (int)$exdate['mday']);
+ }
+ }
+ }
+ }
+ }
+
}