Skip to content
Snippets Groups Projects
Commit e84191e9 authored by Martin Anderson-Clutz's avatar Martin Anderson-Clutz
Browse files

Issue #3274391 by mandclu: Recurring formatter: fatal error when all instances in the past

parent a382af87
No related branches found
No related tags found
No related merge requests found
......@@ -257,7 +257,12 @@ class SmartDateRecurrenceFormatter extends SmartDateDefaultFormatter {
$this->augmentOutput($rrule_output['#rule_text'], $augmenters['rule'], $start['value'], $start['end_value'], $start['timezone'], $delta, 'rule', $repeats, $ends);
}
$next_instance = $instances[$next_index]->getValue();
if ($next_index == -1) {
$next_instance = array_pop($instances)->getValue();
}
else {
$next_instance = $instances[$next_index]->getValue();
}
$rrule_output['#cache']['max-age'] = $next_instance['value'] - \Drupal::time()->getRequestTime();
$elements[$delta] = $rrule_output;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment