diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-28 08:23:30 -0700 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-28 08:23:30 -0700 |
| commit | ba1b224dbc8553a25f9307125ff2f0004602d609 (patch) | |
| tree | e35abd1a1fafbde4af923d990c95e529a4106e2c /www/js/EventCtrl.js | |
| parent | 86ffc8d962c3e4b677a555f215c3dac5e2eabef4 (diff) | |
#353 - show abbreviated timezones to avoid confusion when switching, broadcast tz change if APIs update late
Diffstat (limited to 'www/js/EventCtrl.js')
| -rw-r--r-- | www/js/EventCtrl.js | 17 |
1 files changed, 16 insertions, 1 deletions
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(); |
