From ba1b224dbc8553a25f9307125ff2f0004602d609 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Fri, 28 Oct 2016 08:23:30 -0700 Subject: #353 - show abbreviated timezones to avoid confusion when switching, broadcast tz change if APIs update late --- www/js/EventCtrl.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'www/js/EventCtrl.js') diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 2486ec9a..ce5fec93 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -66,6 +66,11 @@ angular.module('zmApp.controllers') // initial code //--------------------------------------------------- + //we come here is TZ is updated after the view loads + $rootScope.$on('tz-updated', function() { + $scope.tzAbbr = NVRDataModel.getTimeZoneNow(); + NVRDataModel.debug ("Timezone API updated timezone to " + NVRDataModel.getTimeZoneNow()); + }); $rootScope.$on("language-changed", function () { NVRDataModel.log(">>>>>>>>>>>>>>> language changed"); @@ -84,7 +89,17 @@ angular.module('zmApp.controllers') { showHiddenMonitors = false; } - console.log (">>>>>>>>>>>>>>>>>SHOWHIDDEN IS " + showHiddenMonitors); + // console.log (">>>>>>>>>>>>>>>>>SHOWHIDDEN IS " + showHiddenMonitors); + + // lets get the abbreviated version of TZ to display + if (NVRDataModel.getLogin().useLocalTimeZone) + { + $scope.tzAbbr = moment().tz(moment.tz.guess()).zoneAbbr(); + } + else + { + $scope.tzAbbr = moment().tz(NVRDataModel.getTimeZoneNow()).zoneAbbr(); + } $scope.events = []; getInitialEvents(); -- cgit v1.2.3