From 20fc49b7bee997aadb90ab2d58ff680b43a24a84 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Sat, 12 Nov 2011 00:04:37 -0500 Subject: [PATCH] CC-3027: Current Show progress bar is wrong -looks like it's working. --- airtime_mvc/application/models/Schedule.php | 2 +- airtime_mvc/application/models/Show.php | 6 +++--- airtime_mvc/public/js/airtime/dashboard/playlist.js | 10 ++++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index d5db0c091..3fb7df805 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -144,7 +144,7 @@ class Application_Model_Schedule { global $CC_CONFIG; $date = new Application_Model_DateHelper; - $timeNow = $date->getUtcTimestamp(); + $timeNow = $date->getTimestamp(); return array("env"=>APPLICATION_ENV, "schedulerTime"=>$timeNow, "previous"=>Application_Model_Dashboard::GetPreviousItem($timeNow), diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index dc72674eb..38c911bb0 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1383,7 +1383,7 @@ class Application_Model_Show { // Convert back to local timezone $rows = $CC_DBC->GetAll($sql); - Application_Model_Show::ConvertToLocalTimeZone($rows, array("start_timestamp", "end_timestamp")); + Application_Model_Show::ConvertToLocalTimeZone($rows, array("starts", "ends", "start_timestamp", "end_timestamp")); return $rows; } @@ -1424,7 +1424,7 @@ class Application_Model_Show { // Convert timestamps to local timezone $rows = $CC_DBC->GetAll($sql); - Application_Model_Show::ConvertToLocalTimeZone($rows, array("start_timestamp", "end_timestamp")); + Application_Model_Show::ConvertToLocalTimeZone($rows, array("starts", "ends", "start_timestamp", "end_timestamp")); return $rows; } @@ -1478,7 +1478,7 @@ class Application_Model_Show { */ public static function ConvertToLocalTimeZone(&$rows, $columnsToConvert) { $timezone = date_default_timezone_get(); - + foreach($rows as &$row) { foreach($columnsToConvert as $column) { $row[$column] = Application_Model_DateHelper::ConvertToLocalDateTimeString($row[$column]); diff --git a/airtime_mvc/public/js/airtime/dashboard/playlist.js b/airtime_mvc/public/js/airtime/dashboard/playlist.js index d58b8b9f7..070ac4686 100644 --- a/airtime_mvc/public/js/airtime/dashboard/playlist.js +++ b/airtime_mvc/public/js/airtime/dashboard/playlist.js @@ -13,7 +13,7 @@ var currentElem; var serverUpdateInterval = 5000; var uiUpdateInterval = 200; -var timezoneOffset = 0; +//var timezoneOffset = 0; //set to "development" if we are developing :). Useful to disable alerts //when entering production mode. @@ -167,11 +167,13 @@ function updatePlaybar(){ $('#show-length').empty(); if (currentShow.length > 0){ - $('#show-length').text(convertDateToHHMM(currentShow[0].showStartPosixTime + timezoneOffset) + " - " + convertDateToHHMM(currentShow[0].showEndPosixTime + timezoneOffset)); + //$('#show-length').text(convertDateToHHMM(currentShow[0].showStartPosixTime + timezoneOffset) + " - " + convertDateToHHMM(currentShow[0].showEndPosixTime + timezoneOffset)); + $('#show-length').text(convertDateToHHMM(currentShow[0].showStartPosixTime) + " - " + convertDateToHHMM(currentShow[0].showEndPosixTime)); } /* Column 2 update */ - $('#time').text(convertDateToHHMMSS(estimatedSchedulePosixTime + timezoneOffset)); + //$('#time').text(convertDateToHHMMSS(estimatedSchedulePosixTime + timezoneOffset)); + $('#time').text(convertDateToHHMMSS(estimatedSchedulePosixTime)); } function calcAdditionalData(currentItem){ @@ -211,7 +213,7 @@ function parseItems(obj){ calcAdditionalShowData(obj.nextShow); var schedulePosixTime = convertDateToPosixTime(obj.schedulerTime); - timezoneOffset = parseInt(obj.timezoneOffset)*1000; + //timezoneOffset = parseInt(obj.timezoneOffset)*1000; var date = new Date(); localRemoteTimeOffset = date.getTime() - schedulePosixTime; }