/** * Add an exception to the original event. * * @param Kronolith_Event $event The recurring event. * @param object $attributes The attributes passed from the client. * Expected to contain either rstart or rday. * * @return Kronolith_Event The event representing the exception, with * the start/end times set the same as the original * occurence. */ protected function _addException(Kronolith_Event $event, $attributes) { if ($attributes->rstart) { $rstart = new Horde_Date($attributes->rstart); $rstart->setTimezone($event->start->timezone); } else { $rstart = new Horde_Date($attributes->rday); $rstart->setTimezone($event->start->timezone); $rstart->hour = $event->start->hour; $rstart->min = $event->start->min; } $event->recurrence->addException($rstart->year, $rstart->month, $rstart->mday); $event->save(); }