Commit 960a4f71 by Torkel Ödegaard

fix(jsc): fixed javascript indenting

parent 292db86c
...@@ -163,20 +163,6 @@ function($, _, moment) { ...@@ -163,20 +163,6 @@ function($, _, moment) {
return info.sec * info.count; return info.sec * info.count;
}; };
kbn.getRelativeTimeInfo = function(str) {
var info = {value: str};
if (str === 'today') {
info.text = 'Today';
info.from = 'today';
info.to = 'now';
} else {
info.text = 'Last ' + str;
info.from = 'now-'+str;
info.to = 'now';
}
return info;
};
/* This is a simplified version of elasticsearch's date parser */ /* This is a simplified version of elasticsearch's date parser */
kbn.parseDate = function(text) { kbn.parseDate = function(text) {
if(_.isDate(text)) { if(_.isDate(text)) {
...@@ -219,6 +205,20 @@ function($, _, moment) { ...@@ -219,6 +205,20 @@ function($, _, moment) {
return kbn.parseDateMath(mathString, time); return kbn.parseDateMath(mathString, time);
}; };
kbn.getRelativeTimeInfo = function(str) {
var info = {value: str};
if (str === 'today') {
info.text = 'Today';
info.from = 'today';
info.to = 'now';
} else {
info.text = 'Last ' + str;
info.from = 'now-'+str;
info.to = 'now';
}
return info;
};
kbn._timespanRegex = /^(\d+[h,m,M,w,s,H,d])|today$/; kbn._timespanRegex = /^(\d+[h,m,M,w,s,H,d])|today$/;
kbn.isValidTimeSpan = function(str) { kbn.isValidTimeSpan = function(str) {
return kbn._timespanRegex.test(str); return kbn._timespanRegex.test(str);
......
...@@ -69,7 +69,7 @@ function (angular, _, kbn, $) { ...@@ -69,7 +69,7 @@ function (angular, _, kbn, $) {
} }
if (_.isString(scope.rangeUnparsed.from)) { if (_.isString(scope.rangeUnparsed.from)) {
var timeInfo = kbn.getRelativeTimeInfo(scope.panel.timeFrom) var timeInfo = kbn.getRelativeTimeInfo(scope.panel.timeFrom);
scope.panelMeta.timeInfo = timeInfo.text; scope.panelMeta.timeInfo = timeInfo.text;
scope.rangeUnparsed.from = timeInfo.from; scope.rangeUnparsed.from = timeInfo.from;
scope.rangeUnparsed.to = timeInfo.to; scope.rangeUnparsed.to = timeInfo.to;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment