Skip to content
Snippets Groups Projects
Commit 8265ef99 authored by Owen Bush's avatar Owen Bush Committed by Owen Bush
Browse files

Issue #3099593 by owenbush, the_glitch: Consecutive Dates - Only variables...

Issue #3099593 by owenbush, the_glitch: Consecutive Dates - Only variables should be passed by referene
parent f9212a59
No related branches found
No related tags found
No related merge requests found
...@@ -68,11 +68,14 @@ class ConsecutiveRecurringDateWidget extends DateRangeDefaultWidget { ...@@ -68,11 +68,14 @@ class ConsecutiveRecurringDateWidget extends DateRangeDefaultWidget {
]; ];
$times = $this->getTimeOptions(); $times = $this->getTimeOptions();
$time_keys = array_keys($times);
$start_time = reset($time_keys);
$end_time = end($time_keys);
$element['time'] = [ $element['time'] = [
'#type' => 'select', '#type' => 'select',
'#title' => t('First Event Starts At'), '#title' => t('First Event Starts At'),
'#options' => $times, '#options' => $times,
'#default_value' => $items[$delta]->time ?: reset(array_keys($times)), '#default_value' => $items[$delta]->time ?: $start_time,
'#weight' => 3, '#weight' => 3,
'#ajax' => [ '#ajax' => [
'callback' => [$this, 'changeDuration'], 'callback' => [$this, 'changeDuration'],
...@@ -85,7 +88,7 @@ class ConsecutiveRecurringDateWidget extends DateRangeDefaultWidget { ...@@ -85,7 +88,7 @@ class ConsecutiveRecurringDateWidget extends DateRangeDefaultWidget {
'#type' => 'select', '#type' => 'select',
'#title' => t('Final Event Starts At'), '#title' => t('Final Event Starts At'),
'#options' => $times, '#options' => $times,
'#default_value' => $items[$delta]->end_time ?: end(array_keys($times)), '#default_value' => $items[$delta]->end_time ?: $end_time,
'#weight' => 4, '#weight' => 4,
'#ajax' => [ '#ajax' => [
'callback' => [$this, 'changeDuration'], 'callback' => [$this, 'changeDuration'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment