Skip to content

Commit

Permalink
RotationConfigForm: Reorder the (next Week/Day) options
Browse files Browse the repository at this point in the history
These options should be the lat options of the select element
  • Loading branch information
sukhwinder33445 committed Mar 5, 2025
1 parent 29a9d7b commit 1713f8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion application/forms/RotationConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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', [
Expand Down

0 comments on commit 1713f8c

Please sign in to comment.