diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-09 10:42:28 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-10-09 10:42:28 -0400 |
| commit | 986006947c3a6ac404d6868c113a03aaf202dcc2 (patch) | |
| tree | 86691fed62bb5dc40ce228874089de13ab8ae6dc /www/js/MontageHistoryCtrl.js | |
| parent | 82d0d75f6e7be1ed50fc2136a488e5c9e5ab33c5 (diff) | |
simplifying event montage - select X hrs ago too
Former-commit-id: eac8812d33320d75e049da131c3fee631d0ad7f1
Diffstat (limited to 'www/js/MontageHistoryCtrl.js')
| -rw-r--r-- | www/js/MontageHistoryCtrl.js | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index abe1f984..c0188d2d 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -49,8 +49,20 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc return moment(str).format(NVRDataModel.getTimeFormat() + ' on MMMM Do YYYY'); }; + $scope.dateChanged = function() + { + console.log ("DATE CHANGED"); + $scope.datetimeValueFrom.hrs = Math.round(moment.duration(moment().diff(moment($scope.datetimeValueFrom.value))).asHours()); + }; + $scope.hrsChanged = function() + { + $scope.datetimeValueFrom.value = moment().subtract($scope.datetimeValueFrom.hrs,'hours').toDate(); + timefrom.toDate(); + + }; + function orientationChanged() { NVRDataModel.debug("Detected orientation change, redoing packery resize"); @@ -321,12 +333,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc } - $scope.dateChanged = function () { - // window.stop(); - // console.log (">>>>>>>>>>>>>>>>>>>>>>>>>>>>> BAD BAD"); - footerCollapse(); - }; - + //-------------------------------------------------------------- // Used to control zms for a connkey. If ndx is not -1, @@ -1198,6 +1205,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc $rootScope.rand = Math.floor((Math.random() * 100000) + 1); $scope.monitors = []; imageLoadingDataShare.set(0); + var refresh = NVRDataModel.getMonitors(1); @@ -1216,6 +1224,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc var intervalHandle; $scope.isModalActive = false; var modalIntervalHandle; + $scope.hrsAgo = 4; window.addEventListener("resize", orientationChanged, false); @@ -1258,13 +1267,16 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc //tdatetimeValueFrom.setDate(tdatetimeValueFrom.getDate()-1); $scope.datetimeValueFrom = { - value: "" + value: "", + hrs:"" }; $scope.datetimeValueTo = { value: "" }; $scope.datetimeValueFrom.value = timefrom.toDate(); + $scope.datetimeValueFrom.hrs = Math.round(moment.duration(moment().diff(moment($scope.datetimeValueFrom.value))).asHours()); + $scope.datetimeValueTo.value = timeto.toDate(); $rootScope.eventQueryInterval = ""; |
