Skip to content

Commit 8e4d0d1

Browse files
RotationConfigForm: Reorder the (next Week/Day) options
These options should be the lat options of the select element
1 parent 29a9d7b commit 8e4d0d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

application/forms/RotationConfigForm.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ protected function assemblePartialDayOptions(FieldsetElement $options): DateTime
788788

789789
$selectedFromTime = $from->getValue();
790790
foreach ($timeOptions as $key => $value) {
791+
unset($timeOptions[$key]); // unset to re-add it at the end of array
791792
$timeOptions[$key] = sprintf('%s (%s)', $value, $this->translate('Next Day'));
792793

793794
if ($selectedFromTime === $key) {
@@ -876,7 +877,9 @@ protected function assembleMultiDayOptions(FieldsetElement $options): DateTime
876877
$selectedFromDay = (int) $from->getValue();
877878

878879
for ($i = 1; $i <= $selectedFromDay; $i++) {
879-
$toDays[$i] = sprintf('%s (%s)', $toDays[$i], $this->translate('Next week'));
880+
$day = $toDays[$i];
881+
unset($toDays[$i]); // unset to re-add it at the end of array
882+
$toDays[$i] = sprintf('%s (%s)', $day, $this->translate('Next week'));
880883
}
881884

882885
$options->addElement('select', 'to_day', [

0 commit comments

Comments
 (0)