diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-22 13:07:39 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-22 13:07:39 -0400 |
| commit | 017d1416fa9148f84596aa109826cacb13c1c774 (patch) | |
| tree | 9a13dedffae454c835dcdc64e9d5e900a2c16445 /www/js/MontageHistoryCtrl.js | |
| parent | 3e343e28c0120d5ebb540d3400eef86e6f1a7862 (diff) | |
#353 - more timezone tweaks, especially making sure humanizeTime is ALWAYS using local time irrespective of setting
Former-commit-id: d28f076eb0a780a83466f259d17563b8d2d34a0d
Diffstat (limited to 'www/js/MontageHistoryCtrl.js')
| -rw-r--r-- | www/js/MontageHistoryCtrl.js | 14 |
1 files changed, 10 insertions, 4 deletions
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(); |
