diff options
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/TimelineCtrl.js | 25 | ||||
| -rw-r--r-- | www/templates/timeline.html | 6 |
2 files changed, 28 insertions, 3 deletions
diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index 30bb6089..4632b2a8 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -110,6 +110,31 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla }; + //----------------------------------------- + // Move by X days + //----------------------------------------- + $scope.moveDays = function (d) + { + var range = timeline.getWindow(); + var ds = moment(range.start); + if (d>0) + ds.add(d, 'days'); + else + ds.subtract(Math.abs(d), 'days'); + + var es = moment(ds); // clone it! + es.add (1, 'day'); + + fromDate = ds.format("YYYY-MM-DD HH:mm:ss"); + toDate = es.format("YYYY-MM-DD HH:mm:ss"); + + $scope.fromDate = fromDate; + $scope.toDate = toDate; + $rootScope.customTimelineRange = false; + ZMDataModel.zmLog ("moving by " + d + " day to " + fromDate + " upto " + toDate); + drawGraph(fromDate, toDate, maxItems); + + }; diff --git a/www/templates/timeline.html b/www/templates/timeline.html index 7ac71513..0a59e5f9 100644 --- a/www/templates/timeline.html +++ b/www/templates/timeline.html @@ -3,9 +3,9 @@ <ion-nav-buttons side="left"> <button class="button button-icon button-clear ion-navicon" ng-click="openMenu()"></button> - <!-- - <button class="button button-icon button-clear ion-arrow-left-c" ng-click="move(0.2)"></button> - <button class="button button-icon button-clear ion-arrow-right-c" ng-click="move(-0.2)"></button>--> + + <button class="button button-icon button-clear ion-arrow-left-c" ng-click="moveDays(-1);"></button> + <button class="button button-icon button-clear ion-arrow-right-c" ng-click="moveDays(1);"></button> <button data-badge="{{$root.alarmCount}}" class="animated infinite tada button button-icon button-clear ion-ios-bell notification-badge" ng-click="handleAlarms();" ng-if="$root.isAlarm"></button> |
