diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index a8297017f..7eab4e841 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -176,7 +176,7 @@ class Application_Model_Show { //update all cc_show_instances that are in the future. $sql = "UPDATE cc_show_instances SET ends = (ends + interval '{$deltaDay} days' + interval '{$hours}:{$mins}') - WHERE (show_id = {$this->_showId} AND starts > '$current_timestamp') + WHERE (show_id = {$this->_showId} AND ends > '$current_timestamp') AND ((ends + interval '{$deltaDay} days' + interval '{$hours}:{$mins}' - starts) <= interval '24:00');"; //update cc_show_days so future shows can be created with the new duration. @@ -1618,7 +1618,7 @@ class Application_Model_Show { $options["percent"] = Application_Model_Show::getPercentScheduled($show["starts"], $show["ends"], $show["time_filled"]); } - if ($p_editable && (strtotime($today_timestamp) < strtotime($show["starts"]))) { + if ($p_editable && (strtotime($today_timestamp) < strtotime($show["ends"]))) { $options["editable"] = true; }