diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-23 02:00:31 +0530 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-23 02:00:31 +0530 |
| commit | 881c94d1f4b9b4503e7ca97385f7d1b15f70f4b5 (patch) | |
| tree | d18b91292558101fbb2f38694d530a7e10c315f2 /www/js/EventCtrl.js | |
| parent | f36fc1b317743d4ed343088d36c7cdaa1f3515e2 (diff) | |
#353 - allow toggling of server time, also resolves #346 gracefully
Former-commit-id: bd82b1be1e0157eed5531c2d05d6de199308d7a4
Diffstat (limited to 'www/js/EventCtrl.js')
| -rw-r--r-- | www/js/EventCtrl.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index dfdbb779..f5719226 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -676,9 +676,10 @@ angular.module('zmApp.controllers') disableBack: true }); - var mToDate = moment(); - - var mFromDate = moment().subtract(parseInt(val), unit); + + // we have to convert from and to, to server time + var mToDate = moment().tz(NVRDataModel.getTimeZoneNow()); + var mFromDate = moment().subtract(parseInt(val), unit).tz(NVRDataModel.getTimeZoneNow()); // console.log("Moment Dates:" + mFromDate.format() + " TO " + mToDate.format()); |
