CC-5630: Shows created on a DST border get scheduled an extra hour longer

The show start and end time need to be in the show's local timezone when adding
or subtracting time to the start and end time (in case of DST crossings). In this
case the end time was already converted to UTC when we tried to change the time.
This commit is contained in:
drigato 2013-12-11 14:45:16 -05:00
parent 0598c46387
commit 9237692782

View file

@ -1608,14 +1608,15 @@ SQL;
$offset["hours"].":".$offset["mins"], $timezone);
$startDateTime->add(new DateInterval("P{$offset["days"]}D"));
}
//convert time to UTC
$startDateTime->setTimezone(new DateTimeZone('UTC'));
$endDateTime = clone $startDateTime;
$duration = explode(":", $duration);
list($hours, $mins) = array_slice($duration, 0, 2);
$endDateTime->add(new DateInterval("PT{$hours}H{$mins}M"));
$startDateTime->setTimezone(new DateTimeZone('UTC'));
$endDateTime->setTimezone(new DateTimeZone('UTC'));
return array($startDateTime, $endDateTime);
}