diff options
| author | lucas_nz <lucas_nz@outlook.com> | 2020-08-29 21:29:07 +1200 |
|---|---|---|
| committer | lucas_nz <lucas_nz@outlook.com> | 2020-08-31 22:17:03 +1200 |
| commit | 0e5779874010cd8730ee4f788ff4420f70dd2ad2 (patch) | |
| tree | 7fd88366aa0ac14543d71d3316be516c3caea76e /www/js/EventDateTimeFilterCtrl.js | |
| parent | e02255edfba2f055d7a35dea5f6442eeb149632e (diff) | |
when click notification in montage, filter event view to only display events since last notification click
Diffstat (limited to 'www/js/EventDateTimeFilterCtrl.js')
| -rw-r--r-- | www/js/EventDateTimeFilterCtrl.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/www/js/EventDateTimeFilterCtrl.js b/www/js/EventDateTimeFilterCtrl.js index e2d7b22e..689b800d 100644 --- a/www/js/EventDateTimeFilterCtrl.js +++ b/www/js/EventDateTimeFilterCtrl.js @@ -63,6 +63,7 @@ angular.module('zmApp.controllers') $rootScope.toTime = ""; $rootScope.fromString = ""; $rootScope.toString = ""; + $rootScope.monitorsFilter = ''; // if you come here via the events pullup // you are looking at a specific monitor ID @@ -100,6 +101,8 @@ angular.module('zmApp.controllers') // don't root. //-------------------------------------------------------------------------- $scope.saveFilters = function () { + // only reset date/time if at least one of them is set. + if ($rootScope.fromDate || $rootScope.toDate || $rootScope.fromTime || $rootScope.toTime) { if (!$rootScope.fromDate) { //console.log("RESET fromDate"); $rootScope.fromDate = new Date(); @@ -131,11 +134,21 @@ angular.module('zmApp.controllers') $rootScope.fromDate = $rootScope.toDate; $rootScope.toDate = t; } - - $rootScope.isEventFilterOn = true; + $rootScope.fromString = moment($rootScope.fromDate).format("YYYY-MM-DD") + " " + moment($rootScope.fromTime).format("HH:mm:ss"); $rootScope.toString = moment($rootScope.toDate).format("YYYY-MM-DD") + " " + moment($rootScope.toTime).format("HH:mm:ss"); + } + else { + $rootScope.fromDate = null; + $rootScope.toDate = null; + $rootScope.fromTime = null; + $rootScope.toTime = null; + $rootScope.fromString = null; + $rootScope.toString = null; + } + + $rootScope.isEventFilterOn = true; //console.log("CONCAT DATES " + temp); // |
