CC-5323: User's Timezone Can Improperly Edit Show
Sometimes show form would populate the start/end time with wrong timezone
This commit is contained in:
parent
e57b6e3e3d
commit
34e2344100
2 changed files with 7 additions and 7 deletions
|
@ -166,10 +166,10 @@ class Application_Service_ShowFormService
|
|||
|
||||
//DateTime object in UTC
|
||||
$showStart = $ccShowInstance->getDbStarts(null);
|
||||
$showStart->setTimezone($timezone);
|
||||
$showStart->setTimezone(new DateTimeZone($timezone));
|
||||
|
||||
$showEnd = $ccShowInstance->getDbEnds(null);
|
||||
$showEnd->setTimezone($timezone);
|
||||
$showEnd->setTimezone(new DateTimeZone($timezone));
|
||||
|
||||
//if the show has started, do not allow editing on the start time
|
||||
if ($showStart->getTimestamp() <= time()) {
|
||||
|
@ -395,10 +395,10 @@ class Application_Service_ShowFormService
|
|||
|
||||
$starts = new DateTime($ccShowInstance->getDbStarts(), new DateTimeZone("UTC"));
|
||||
$ends = new DateTime($ccShowInstance->getDbEnds(), new DateTimeZone("UTC"));
|
||||
$userTimezone = Application_Model_Preference::GetTimezone();
|
||||
$showTimezone = $this->ccShow->getFirstCcShowDay()->getDbTimezone();
|
||||
|
||||
$starts->setTimezone(new DateTimeZone($userTimezone));
|
||||
$ends->setTimezone(new DateTimeZone($userTimezone));
|
||||
$starts->setTimezone(new DateTimeZone($showTimezone));
|
||||
$ends->setTimezone(new DateTimeZone($showTimezone));
|
||||
|
||||
return array($starts, $ends);
|
||||
}
|
||||
|
|
|
@ -54,10 +54,10 @@ class Application_Service_ShowService
|
|||
$oldCcShow = CcShowQuery::create()
|
||||
->findPk($showData["add_show_id"]);
|
||||
|
||||
//DateTime in user's local time
|
||||
//DateTime in shows's local time
|
||||
$newStartDateTime = new DateTime($showData["add_show_start_date"]." ".
|
||||
$showData["add_show_start_time"],
|
||||
new DateTimeZone(Application_Model_Preference::GetTimezone()));
|
||||
new DateTimeZone($showData["add_show_timezone"]));
|
||||
|
||||
$ccShowInstanceOrig = CcShowInstancesQuery::create()
|
||||
->findPk($showData["add_show_instance_id"]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue