feat(relative time override): You can now use the new relative time option in panel time override, closes #2575

This commit is contained in:
Torkel Ödegaard
2015-08-21 16:19:51 +02:00
parent 6d3b36d61b
commit 292db86c9e
3 changed files with 42 additions and 36 deletions

View File

@@ -74,17 +74,7 @@ function (angular, app, _, moment, kbn) {
$scope.loadTimeOptions = function() {
$scope.time_options = _.map($scope.panel.time_options, function(str) {
var option = {value: str};
if (str === 'today') {
option.text = 'Today';
option.from = 'today';
option.to = 'now';
} else {
option.text = 'Last ' + str;
option.from = 'now-'+str;
option.to = 'now';
}
return option;
return kbn.getRelativeTimeInfo(str);
});
$scope.refreshMenuLeftSide = $scope.time.rangeString.length < 10;