From 017d1416fa9148f84596aa109826cacb13c1c774 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 22 Oct 2016 13:07:39 -0400 Subject: #353 - more timezone tweaks, especially making sure humanizeTime is ALWAYS using local time irrespective of setting Former-commit-id: d28f076eb0a780a83466f259d17563b8d2d34a0d --- www/js/MontageHistoryCtrl.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'www/js/MontageHistoryCtrl.js') diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index 050d8e17..7b1ca2c1 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -12,6 +12,11 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc // nothing to do for now // eventUrl will use lower BW in next query cycle }); + + $scope.getLocalTZ = function() + { + return moment.tz.guess(); + }; //-------------------------------------- // formats events dates in a nice way //--------------------------------------- @@ -44,10 +49,10 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc return moment(str).format(NVRDataModel.getTimeFormat() + ' on MMMM Do YYYY'); }; $scope.humanizeTime = function (str) { - if (NVRDataModel.getLogin().useLocalTimeZone) + // if (NVRDataModel.getLogin().useLocalTimeZone) return moment.tz(str, NVRDataModel.getTimeZoneNow()).fromNow(); - else - return moment(str).fromNow(); + // else + // return moment(str).fromNow(); }; // if you change date in footer, change hrs @@ -197,7 +202,8 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc var TimeObjectTo = moment().format('YYYY-MM-DD HH:mm'); // At this point of time, we need to ensure From and To are changed to server time - if (NVRDataModel.getLogin().useLocalTimeZone) + //if (NVRDataModel.getLogin().useLocalTimeZone) + if (1) { var localtz = moment.tz.guess(); var servertz = NVRDataModel.getTimeZoneNow(); -- cgit v1.2.3