Skip to content

Commit

Permalink
Closes #10978 - Added 'Set To Now' button to from (#10985)
Browse files Browse the repository at this point in the history
  • Loading branch information
simianhacker committed Mar 31, 2017
1 parent 9a6b3a3 commit 23ec2f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/ui/public/timepicker/timepicker.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<div class="kbn-timepicker-section">
<div>
<label class="small">From: <span ng-show="!absolute.from"><i>Invalid Date</i></span>
<a class="label label-default" ng-click="setToNow('from')">Set To Now</a>
</label>
<input type="text" required class="form-control" input-datetime="{{format}}" ng-model="absolute.from">
</div>
Expand All @@ -113,7 +114,7 @@
<div class="kbn-timepicker-section">
<div>
<label class="small">To:
<a class="label label-default" ng-click="setToNow()">Set To Now</a>
<a class="label label-default" ng-click="setToNow('to')">Set To Now</a>
</label>
<span ng-show="!absolute.to"><i>Invalid Date</i></span>
<input type="text" required class="form-control" input-datetime="{{format}}" ng-model="absolute.to">
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/timepicker/timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshInter
$scope.onFilterSelect({ from, to });
};

$scope.setToNow = function () {
$scope.absolute.to = moment();
$scope.setToNow = function (key) {
$scope.absolute[key] = moment();
};

$scope.formatRelative = function () {
Expand Down

0 comments on commit 23ec2f1

Please sign in to comment.