From 1713f8ce4876d7a69d18ce79c0bf9bf4e4259b23 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Wed, 5 Mar 2025 15:17:22 +0100 Subject: [PATCH] RotationConfigForm: Reorder the (next Week/Day) options These options should be the lat options of the select element --- application/forms/RotationConfigForm.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/forms/RotationConfigForm.php b/application/forms/RotationConfigForm.php index a6d4b817..1ef67788 100644 --- a/application/forms/RotationConfigForm.php +++ b/application/forms/RotationConfigForm.php @@ -788,6 +788,7 @@ protected function assemblePartialDayOptions(FieldsetElement $options): DateTime $selectedFromTime = $from->getValue(); foreach ($timeOptions as $key => $value) { + unset($timeOptions[$key]); // unset to re-add it at the end of array $timeOptions[$key] = sprintf('%s (%s)', $value, $this->translate('Next Day')); if ($selectedFromTime === $key) { @@ -876,7 +877,9 @@ protected function assembleMultiDayOptions(FieldsetElement $options): DateTime $selectedFromDay = (int) $from->getValue(); for ($i = 1; $i <= $selectedFromDay; $i++) { - $toDays[$i] = sprintf('%s (%s)', $toDays[$i], $this->translate('Next week')); + $day = $toDays[$i]; + unset($toDays[$i]); // unset to re-add it at the end of array + $toDays[$i] = sprintf('%s (%s)', $day, $this->translate('Next week')); } $options->addElement('select', 'to_day', [