tslint: more const fixes (#13035)

This commit is contained in:
Torkel Ödegaard
2018-08-26 20:19:23 +02:00
committed by GitHub
parent 314b645857
commit 35c00891e7
32 changed files with 120 additions and 123 deletions

View File

@@ -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 {

View File

@@ -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;