From 6ea0cb5918d7295496e27db1196afafd1511148b Mon Sep 17 00:00:00 2001 From: drigato Date: Fri, 22 Nov 2013 10:51:16 -0500 Subject: [PATCH] CC-5571: Overlapping show check in wrong sometimes The incorrect number of days we're getting added to create repeat instances because we were checking the start week day in UTC instead of local time --- airtime_mvc/application/forms/AddShowWhen.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index a040032cb..ebd820042 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -169,6 +169,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm $utc = new DateTimeZone('UTC'); $showTimezone = new DateTimeZone($formData["add_show_timezone"]); $show_start = new DateTime($start_time, $showTimezone); + //we need to know the start day of the week in show's local timezome + $startDow = $show_start->format("w"); $show_start->setTimezone($utc); $show_end = new DateTime($end_time, $showTimezone); $show_end->setTimezone($utc); @@ -220,7 +222,6 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm * Do this for each show day */ if (!$overlapping) { - $startDow = $show_start->format("w"); if (!isset($formData['add_show_day_check'])) { return false; @@ -240,7 +241,6 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm * to convert show start and show end to local time before * adding the interval for the next repeating show */ - $repeatShowStart->setTimezone($showTimezone); $repeatShowEnd->setTimezone($showTimezone); $repeatShowStart->add(new DateInterval("P".$daysAdd."D"));