Skip to content

Commit

Permalink
Fix bug causing the period to be reported incorrectly under certain c…
Browse files Browse the repository at this point in the history
…ircumstances
  • Loading branch information
campbell-m committed May 1, 2024
1 parent 9257801 commit ac23c54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/functions.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,7 @@ function period_date_string(int $t, int $area_id, bool $previous_period=false) :
{
global $datetime_formats;

$period_names = get_period_names();
$period_names = get_period_names()[$area_id];
$n_periods = count($period_names);
$time = getdate($t);
$p = $time['minutes'];
Expand All @@ -1935,7 +1935,7 @@ function period_date_string(int $t, int $area_id, bool $previous_period=false) :

// The separator is a ',' as a '-' leads to an ambiguous
// display in report.php when showing end times.
return array($p, $period_names[$area_id][$p] . ', ' . datetime_format($datetime_formats['date'], $t));
return array($p, $period_names[$p] . ', ' . datetime_format($datetime_formats['date'], $t));
}


Expand Down

0 comments on commit ac23c54

Please sign in to comment.