Skip to content

Commit 0b0b74e

Browse files
committed
Add times for the next day to own option group
This is because we want to remove the parentheses for future changes where those should be used to display a time in another timezone.
1 parent d60c04c commit 0b0b74e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

application/forms/RotationConfigForm.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,9 +802,10 @@ protected function assemblePartialDayOptions(FieldsetElement $options): DateTime
802802
]);
803803

804804
$selectedFromTime = $from->getValue();
805+
$nextDayTimeOptions = [];
805806
foreach ($timeOptions as $key => $value) {
806-
unset($timeOptions[$key]); // unset to re-add it at the end of array
807-
$timeOptions[$key] = sprintf('%s (%s)', $value, $this->translate('Next Day'));
807+
unset($timeOptions[$key]);
808+
$nextDayTimeOptions[$key] = $value;
808809

809810
if ($selectedFromTime === $key) {
810811
break;
@@ -813,7 +814,9 @@ protected function assemblePartialDayOptions(FieldsetElement $options): DateTime
813814

814815
$to = $options->createElement('select', 'to', [
815816
'required' => true,
816-
'options' => $timeOptions
817+
'options' => empty($timeOptions)
818+
? ['Next Day' => $nextDayTimeOptions]
819+
: ['Today' => $timeOptions, 'Next Day' => $nextDayTimeOptions]
817820
]);
818821
$options->registerElement($to);
819822

0 commit comments

Comments
 (0)