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
This commit is contained in:
parent
463d286ac5
commit
7f8f084c98
|
@ -40,8 +40,7 @@ class CcShowDays extends BaseCcShowDays {
|
||||||
);
|
);
|
||||||
|
|
||||||
//set timezone to that of the show
|
//set timezone to that of the show
|
||||||
$dt->setTimezone(new DateTimeZone($this->getDbTimezone()));
|
//$dt->setTimezone(new DateTimeZone($this->getDbTimezone()));
|
||||||
|
|
||||||
return $dt;
|
return $dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,9 +49,9 @@ class CcShowDays extends BaseCcShowDays {
|
||||||
* Returns the end of a show in the timezone it was created in
|
* Returns the end of a show in the timezone it was created in
|
||||||
* @param DateTime $startDateTime first show in show's local time
|
* @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());
|
$duration = explode(":", $this->getDbDuration());
|
||||||
|
|
||||||
return $startDateTime->add(new DateInterval('PT'.$duration[0].'H'.$duration[1].'M'));
|
return $startDateTime->add(new DateInterval('PT'.$duration[0].'H'.$duration[1].'M'));
|
||||||
|
|
|
@ -131,7 +131,7 @@ class Application_Service_ShowFormService
|
||||||
}
|
}
|
||||||
|
|
||||||
$showStart = $ccShowDay->getLocalStartDateAndTime();
|
$showStart = $ccShowDay->getLocalStartDateAndTime();
|
||||||
$showEnd = $ccShowDay->getLocalEndDateAndTime($showStart);
|
$showEnd = $ccShowDay->getLocalEndDateAndTime();
|
||||||
|
|
||||||
//check if the first show is in the past
|
//check if the first show is in the past
|
||||||
if ($ccShowDay->isShowStartInPast()) {
|
if ($ccShowDay->isShowStartInPast()) {
|
||||||
|
|
Loading…
Reference in New Issue