mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(relative time override): You can now use the new relative time option in panel time override, closes #2575
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user