From e7086cf6df01b985bc46e194e63854692f08e298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 7 Aug 2014 07:58:14 +0200 Subject: [PATCH] Timepicker: Fix for setting custom To date with low refresh interval, Fixes #652 --- CHANGELOG.md | 1 + src/app/panels/timepicker/custom.html | 6 +++--- src/app/panels/timepicker/module.js | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fcda5b77ba..c25d93f18d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ **Fixes** - [Issue #655](https://github.com/grafana/grafana/issues/655). General: Auto refresh not initiated / started after dashboard loading +- [Issue #652](https://github.com/grafana/grafana/issues/652). Timepicker: Entering custom date range impossible when refresh is low (now is constantly reset) # 1.7.0-rc1 (2014-08-05) diff --git a/src/app/panels/timepicker/custom.html b/src/app/panels/timepicker/custom.html index 474d1ce8f8e..0784cf987e0 100644 --- a/src/app/panels/timepicker/custom.html +++ b/src/app/panels/timepicker/custom.html @@ -49,17 +49,17 @@
- +
-
+
@ : : .
-   Right Now +   Right Now
diff --git a/src/app/panels/timepicker/module.js b/src/app/panels/timepicker/module.js index 614c3000690..da9f91a0e66 100644 --- a/src/app/panels/timepicker/module.js +++ b/src/app/panels/timepicker/module.js @@ -78,6 +78,7 @@ function (angular, app, _, moment, kbn) { // Assume the form is valid since we're setting it to something valid $scope.input.$setValidity("dummy", true); $scope.temptime = cloneTime($scope.time); + $scope.tempnow = $scope.panel.now; // Date picker needs the date to be at the start of the day $scope.temptime.from.date.setHours(1,0,0,0); @@ -129,7 +130,7 @@ function (angular, app, _, moment, kbn) { // Create filter object var _filter = _.clone(time); - if($scope.panel.now) { + if($scope.tempnow) { _filter.to = "now"; }