private function updateEventFromNode(PhabricatorUser $actor, PhabricatorCalendarEvent $event, PhutilCalendarEventNode $node) { $instance_epoch = $this->getNodeInstanceEpoch($node); $event->setUTCInstanceEpoch($instance_epoch); $timezone = $actor->getTimezoneIdentifier(); // TODO: These should be transactional, but the transaction only accepts // epoch timestamps right now. $start_datetime = $node->getStartDateTime()->setViewerTimezone($timezone); $end_datetime = $node->getEndDateTime()->setViewerTimezone($timezone); $event->setStartDateTime($start_datetime)->setEndDateTime($end_datetime); $event->setIsAllDay((int) $start_datetime->getIsAllDay()); // TODO: This should be transactional, but the transaction only accepts // simple frequency rules right now. $rrule = $node->getRecurrenceRule(); if ($rrule) { $event->setRecurrenceRule($rrule); $until_datetime = $rrule->getUntil(); if ($until_datetime) { $until_datetime->setViewerTimezone($timezone); $event->setUntilDateTime($until_datetime); } $count = $rrule->getCount(); $event->setParameter('recurrenceCount', $count); } return $event; }