From e69eb9c2b1a01bfd654dc5cc891f9c10d83f2c26 Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 6 Jul 2015 09:33:04 -0400 Subject: [PATCH 1/5] SAAS-916: Localize schedule widget dates --- airtime_mvc/application/common/WidgetHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/common/WidgetHelper.php b/airtime_mvc/application/common/WidgetHelper.php index a60969d3b..c715ed5e5 100644 --- a/airtime_mvc/application/common/WidgetHelper.php +++ b/airtime_mvc/application/common/WidgetHelper.php @@ -98,7 +98,7 @@ class WidgetHelper // javascript date formats so it's easier to sort the shows by day. $result["weekDays"][$weekStartDateTime->format("Y-n-j")] = array(); $result["weekDays"][$weekStartDateTime->format("Y-n-j")]["dayOfMonth"] = $dateParse["day"]; - $result["weekDays"][$weekStartDateTime->format("Y-n-j")]["dayOfWeek"] = strtoupper(date("D", $weekStartDateTime->getTimestamp())); + $result["weekDays"][$weekStartDateTime->format("Y-n-j")]["dayOfWeek"] = _(strtoupper(date("D", $weekStartDateTime->getTimestamp()))); // Shows scheduled for this day will get added to this array when // we convert the show times to the client's local timezone in weekly-program.phtml From 6914e161653409163faa5c49e97cc9cc1c0991ca Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 6 Jul 2015 10:21:27 -0400 Subject: [PATCH 2/5] SAAS-916: Localize schedule widget dates Forgot to commit msg strings for this --- airtime_mvc/application/controllers/LocaleController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/airtime_mvc/application/controllers/LocaleController.php b/airtime_mvc/application/controllers/LocaleController.php index 7d83a165e..444bc058e 100644 --- a/airtime_mvc/application/controllers/LocaleController.php +++ b/airtime_mvc/application/controllers/LocaleController.php @@ -251,6 +251,13 @@ class LocaleController extends Zend_Controller_Action "Thu" => _("Thu"), "Fri" => _("Fri"), "Sat" => _("Sat"), + "SUN" => _("SUN"), + "MON" => _("MON"), + "TUE" => _("TUE"), + "WED" => _("WED"), + "THU" => _("THU"), + "FRI" => _("FRI"), + "SAT" => _("SAT"), "Shows longer than their scheduled time will be cut off by a following show." => _("Shows longer than their scheduled time will be cut off by a following show."), "Cancel Current Show?" => _("Cancel Current Show?"), "Stop recording current show?" => _("Stop recording current show?"), From 71b2a4e94694337ac09253f3faac51f6e0814a69 Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 6 Jul 2015 10:29:02 -0400 Subject: [PATCH 3/5] Removing duplicate locale strings --- airtime_mvc/application/controllers/LocaleController.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/airtime_mvc/application/controllers/LocaleController.php b/airtime_mvc/application/controllers/LocaleController.php index 444bc058e..7d83a165e 100644 --- a/airtime_mvc/application/controllers/LocaleController.php +++ b/airtime_mvc/application/controllers/LocaleController.php @@ -251,13 +251,6 @@ class LocaleController extends Zend_Controller_Action "Thu" => _("Thu"), "Fri" => _("Fri"), "Sat" => _("Sat"), - "SUN" => _("SUN"), - "MON" => _("MON"), - "TUE" => _("TUE"), - "WED" => _("WED"), - "THU" => _("THU"), - "FRI" => _("FRI"), - "SAT" => _("SAT"), "Shows longer than their scheduled time will be cut off by a following show." => _("Shows longer than their scheduled time will be cut off by a following show."), "Cancel Current Show?" => _("Cancel Current Show?"), "Stop recording current show?" => _("Stop recording current show?"), From f86c50a834a90db9057eb552e3febf5ad23e4ed9 Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 6 Jul 2015 10:30:16 -0400 Subject: [PATCH 4/5] SAAS-916: Localize schedule widget dates Fix to use existing locale strings --- airtime_mvc/application/common/WidgetHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/common/WidgetHelper.php b/airtime_mvc/application/common/WidgetHelper.php index c715ed5e5..d22727ad9 100644 --- a/airtime_mvc/application/common/WidgetHelper.php +++ b/airtime_mvc/application/common/WidgetHelper.php @@ -98,7 +98,7 @@ class WidgetHelper // javascript date formats so it's easier to sort the shows by day. $result["weekDays"][$weekStartDateTime->format("Y-n-j")] = array(); $result["weekDays"][$weekStartDateTime->format("Y-n-j")]["dayOfMonth"] = $dateParse["day"]; - $result["weekDays"][$weekStartDateTime->format("Y-n-j")]["dayOfWeek"] = _(strtoupper(date("D", $weekStartDateTime->getTimestamp()))); + $result["weekDays"][$weekStartDateTime->format("Y-n-j")]["dayOfWeek"] = strtoupper(_(date("D", $weekStartDateTime->getTimestamp()))); // Shows scheduled for this day will get added to this array when // we convert the show times to the client's local timezone in weekly-program.phtml From ec0fbd2d6140be09e37fe8e2c6a01b6b1f77de3b Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 6 Jul 2015 10:47:04 -0400 Subject: [PATCH 5/5] Fix for schedule widget weekdays going out of order --- .../application/views/scripts/embed/weekly-program.phtml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/views/scripts/embed/weekly-program.phtml b/airtime_mvc/application/views/scripts/embed/weekly-program.phtml index 0b4cdb0a5..872afc849 100644 --- a/airtime_mvc/application/views/scripts/embed/weekly-program.phtml +++ b/airtime_mvc/application/views/scripts/embed/weekly-program.phtml @@ -59,7 +59,11 @@ }); } }); - $scope.weekDays = $window.schedule_data["weekDays"]; + // Convert the object into an array to maintain the same order when we + // iterate over each weekday + $scope.weekDays = $.map($window.schedule_data["weekDays"], function(value, index) { + return [value]; + }); $scope.isEmpty = function(obj) { return obj.length == 0;