Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #10978 - Added 'Set To Now' button to from #10985

Merged
merged 1 commit into from Mar 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ui/public/timepicker/timepicker.html
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
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