/** * Filter recurrence / exclusion rule or dates. Avoid throwing exception for old, malformed values. * * @param string $rule Rule or dates value. * * @return string Fixed rule or dates value. */ protected function _filter_rule($rule) { if (null === $this->_rule_filter) { $this->_rule_filter = $this->_registry->get('recurrence.rule'); } return $this->_rule_filter->filter_rule($rule); }
/** * Get the html for the exclude dates and exception rules. * * @param Ai1ec_Event $event * @param Ai1ec_Recurrence_Rule $rrule * @return string */ public function get_exclude_html(Ai1ec_Event $event, Ai1ec_Recurrence_Rule $rrule) { $excludes = array(); $exception_rules = $event->get('exception_rules'); $exception_dates = $event->get('exception_dates'); if ($exception_rules) { $excludes[] = $rrule->rrule_to_text($exception_rules); } if ($exception_dates && 0 !== strpos($exception_rules, 'EXDATE')) { $excludes[] = $rrule->exdate_to_text($exception_dates); } return implode(Ai1ec_I18n::__(', and '), $excludes); }