CC-5321 : Changing Timezone after Creating shows creates Problems

This commit is contained in:
Naomi Aro 2013-09-06 12:35:31 +02:00
parent 0734a4a98c
commit 5a85fce89d
1 changed files with 41 additions and 40 deletions

View File

@ -964,8 +964,9 @@ SQL;
*/ */
if (isset($lastCreatedShow)) { if (isset($lastCreatedShow)) {
/* Set UTC to local time before setting the next repeat date. If we don't /* Set UTC to local time before setting the next repeat date. If we don't
* the next repeat date might be scheduled for the following day */ * the next repeat date might be scheduled for the following day
$lastCreatedShow->setTimezone(new DateTimeZone(Application_Model_Preference::GetTimezone())); * THIS MUST BE IN THE TIMEZONE THE SHOW WAS CREATED IN */
$lastCreatedShow->setTimezone(new DateTimeZone($timezone));
$nextDate = $lastCreatedShow->add($repeatInterval); $nextDate = $lastCreatedShow->add($repeatInterval);
$this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day, $show_id); $this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day, $show_id);
} }