Skip to content

Commit

Permalink
Fix bug causing the incorrect end time and duration to be shown when …
Browse files Browse the repository at this point in the history
…using periods in a system with areas using different timezones.
  • Loading branch information
campbell-m committed Jan 13, 2025
1 parent 93fd6e6 commit f93a52f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/mrbs_sql.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ declare(strict_types=1);
namespace MRBS;

use DateTimeImmutable;
use DateTimeZone;
use MRBS\ICalendar\RFC5545;

define('INTERVAL_DAY', 0);
Expand Down Expand Up @@ -1919,7 +1920,8 @@ function get_booking_info(int $id, bool $series, bool $silent=false)
{
$period_names = get_period_names();
$n_periods = count($period_names[$row['area_id']]);
$end_date = new DateTime();
$area_details = get_area_details($row['area_id']);
$end_date = new DateTime('now', new DateTimeZone($area_details['timezone']));
$end_date->setTimestamp($row['end_time']);
$hour = $end_date->getHour();
// If the time is between midnight and the start of the first period, then
Expand Down

0 comments on commit f93a52f

Please sign in to comment.