CC-5384: Drag & drop show sets wrong time

Start time was getting stored in UTC in cc_show_days when it
should be stored in the show's local timezone
This commit is contained in:
denise 2013-10-09 16:55:56 -04:00
parent 256ec9292d
commit aadbf0b200

View file

@ -231,9 +231,9 @@ class Application_Service_CalendarService
//the user is moving the show on the calendar from the perspective of local time. //the user is moving the show on the calendar from the perspective of local time.
//incase a show is moved across a time change border offsets should be added to the localtime //incase a show is moved across a time change border offsets should be added to the localtime
//stamp and then converted back to UTC to avoid show time changes! //stamp and then converted back to UTC to avoid show time changes!
$localTimezone = Application_Model_Preference::GetTimezone(); $showTimezone = $this->ccShow->getFirstCcShowDay()->getDbTimezone();
$startsDateTime->setTimezone(new DateTimeZone($localTimezone)); $startsDateTime->setTimezone(new DateTimeZone($showTimezone));
$endsDateTime->setTimezone(new DateTimeZone($localTimezone)); $endsDateTime->setTimezone(new DateTimeZone($showTimezone));
$newStartsDateTime = self::addDeltas($startsDateTime, $deltaDay, $deltaMin); $newStartsDateTime = self::addDeltas($startsDateTime, $deltaDay, $deltaMin);
$newEndsDateTime = self::addDeltas($endsDateTime, $deltaDay, $deltaMin); $newEndsDateTime = self::addDeltas($endsDateTime, $deltaDay, $deltaMin);
@ -303,9 +303,10 @@ class Application_Service_CalendarService
//we can get the first show day because we know the show is //we can get the first show day because we know the show is
//not repeating, and therefore will only have one show day entry //not repeating, and therefore will only have one show day entry
$ccShowDay = $this->ccShow->getFirstCcShowDay(); $ccShowDay = $this->ccShow->getFirstCcShowDay();
$showTimezone = new DateTimeZone($ccShowDay->getDbTimezone());
$ccShowDay $ccShowDay
->setDbFirstShow($newStartsDateTime) ->setDbFirstShow($newStartsDateTime->setTimezone($showTimezone))
->setDbLastShow($newEndsDateTime) ->setDbLastShow($newEndsDateTime->setTimezone($showTimezone))
->save(); ->save();
} }