From 7f8f084c9807947aa5e52ea3ae67e25730a3c198 Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 4 Dec 2013 14:17:19 -0500 Subject: [PATCH] CC-5405: When editing a single show instance from a repeating series, should not create a new cc_show Refactored cc_show_day->getLocalEndDateAndTime() function --- airtime_mvc/application/models/airtime/CcShowDays.php | 7 +++---- airtime_mvc/application/services/ShowFormService.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/models/airtime/CcShowDays.php b/airtime_mvc/application/models/airtime/CcShowDays.php index 215ebdcf8..2f187bf44 100644 --- a/airtime_mvc/application/models/airtime/CcShowDays.php +++ b/airtime_mvc/application/models/airtime/CcShowDays.php @@ -40,8 +40,7 @@ class CcShowDays extends BaseCcShowDays { ); //set timezone to that of the show - $dt->setTimezone(new DateTimeZone($this->getDbTimezone())); - + //$dt->setTimezone(new DateTimeZone($this->getDbTimezone())); return $dt; } @@ -50,9 +49,9 @@ class CcShowDays extends BaseCcShowDays { * Returns the end of a show in the timezone it was created in * @param DateTime $startDateTime first show in show's local time */ - public function getLocalEndDateAndTime($showStart) + public function getLocalEndDateAndTime() { - $startDateTime = clone $showStart; + $startDateTime = $this->getLocalStartDateAndTime(); $duration = explode(":", $this->getDbDuration()); return $startDateTime->add(new DateInterval('PT'.$duration[0].'H'.$duration[1].'M')); diff --git a/airtime_mvc/application/services/ShowFormService.php b/airtime_mvc/application/services/ShowFormService.php index 85b9868c0..1d513587d 100644 --- a/airtime_mvc/application/services/ShowFormService.php +++ b/airtime_mvc/application/services/ShowFormService.php @@ -131,7 +131,7 @@ class Application_Service_ShowFormService } $showStart = $ccShowDay->getLocalStartDateAndTime(); - $showEnd = $ccShowDay->getLocalEndDateAndTime($showStart); + $showEnd = $ccShowDay->getLocalEndDateAndTime(); //check if the first show is in the past if ($ccShowDay->isShowStartInPast()) {