mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tslint: more const fixes (#13035)
This commit is contained in:
@@ -6,9 +6,9 @@ export function inputDateDirective() {
|
||||
restrict: 'A',
|
||||
require: 'ngModel',
|
||||
link: function($scope, $elem, attrs, ngModel) {
|
||||
var format = 'YYYY-MM-DD HH:mm:ss';
|
||||
const format = 'YYYY-MM-DD HH:mm:ss';
|
||||
|
||||
var fromUser = function(text) {
|
||||
const fromUser = function(text) {
|
||||
if (text.indexOf('now') !== -1) {
|
||||
if (!dateMath.isValid(text)) {
|
||||
ngModel.$setValidity('error', false);
|
||||
@@ -34,7 +34,7 @@ export function inputDateDirective() {
|
||||
return parsed;
|
||||
};
|
||||
|
||||
var toUser = function(currentValue) {
|
||||
const toUser = function(currentValue) {
|
||||
if (moment.isMoment(currentValue)) {
|
||||
return currentValue.format(format);
|
||||
} else {
|
||||
|
||||
@@ -43,8 +43,8 @@ export class TimePickerCtrl {
|
||||
}
|
||||
|
||||
onRefresh() {
|
||||
var time = angular.copy(this.timeSrv.timeRange());
|
||||
var timeRaw = angular.copy(time.raw);
|
||||
const time = angular.copy(this.timeSrv.timeRange());
|
||||
const timeRaw = angular.copy(time.raw);
|
||||
|
||||
if (!this.dashboard.isTimezoneUtc()) {
|
||||
time.from.local();
|
||||
@@ -72,9 +72,9 @@ export class TimePickerCtrl {
|
||||
}
|
||||
|
||||
move(direction) {
|
||||
var range = this.timeSrv.timeRange();
|
||||
const range = this.timeSrv.timeRange();
|
||||
|
||||
var timespan = (range.to.valueOf() - range.from.valueOf()) / 2;
|
||||
const timespan = (range.to.valueOf() - range.from.valueOf()) / 2;
|
||||
var to, from;
|
||||
if (direction === -1) {
|
||||
to = range.to.valueOf() - timespan;
|
||||
@@ -142,7 +142,7 @@ export class TimePickerCtrl {
|
||||
}
|
||||
|
||||
setRelativeFilter(timespan) {
|
||||
var range = { from: timespan.from, to: timespan.to };
|
||||
const range = { from: timespan.from, to: timespan.to };
|
||||
|
||||
if (this.panel.nowDelay && range.to === 'now') {
|
||||
range.to = 'now-' + this.panel.nowDelay;
|
||||
|
||||
Reference in New Issue
Block a user