Aw4751 eslint fixes
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -13,8 +13,8 @@ export class TimespanService {
|
||||
units: string[] = ['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'];
|
||||
quarters: string[] = ['KW1', 'KW2', 'KW3', 'KW4'];
|
||||
|
||||
getStartEndCaption(date: Date, otherDate: Date, unitScale: number, suffix: boolean = false, extended: boolean = true): string {
|
||||
let showSuffix = false;
|
||||
getStartEndCaption(date: Date, otherDate: Date, unitScale: number, suffix = false, extended = true): string {
|
||||
const showSuffix = false;
|
||||
otherDate = new Date(otherDate.getTime() - 1); // fix year edge case
|
||||
if (unitScale == 3) {
|
||||
let format = "HH:00";
|
||||
@@ -47,7 +47,7 @@ export class TimespanService {
|
||||
return this.datePipe.transform(date, format);
|
||||
}
|
||||
if (unitScale == 7) {
|
||||
let q = Math.trunc(date.getMonth() / 3);
|
||||
const q = Math.trunc(date.getMonth() / 3);
|
||||
return this.quarters[q];
|
||||
}
|
||||
if (unitScale == 8) {
|
||||
@@ -56,11 +56,11 @@ export class TimespanService {
|
||||
return "";
|
||||
}
|
||||
|
||||
getStartCaption(startDate: Date, endDate: Date, unitScale: number, suffix: boolean = false, extended: boolean = true): string {
|
||||
getStartCaption(startDate: Date, endDate: Date, unitScale: number, suffix = false, extended = true): string {
|
||||
return this.getStartEndCaption(new Date(startDate.getTime() + (this.unitScales[unitScale] / 2)), endDate, unitScale, suffix, extended);
|
||||
}
|
||||
|
||||
getEndCaption(startDate: Date,endDate: Date, unitScale: number, suffix: boolean = true): string {
|
||||
getEndCaption(startDate: Date,endDate: Date, unitScale: number, suffix = true): string {
|
||||
return this.getStartEndCaption(new Date(endDate.getTime() - (this.unitScales[unitScale] / 2)), startDate, unitScale, suffix);
|
||||
}
|
||||
|
||||
@@ -75,8 +75,8 @@ export class TimespanService {
|
||||
scale =3
|
||||
}
|
||||
}
|
||||
let startCaption = this.getStartCaption(startDate, endDate, scale);
|
||||
let endCaption = this.getEndCaption(startDate,endDate, scale);
|
||||
const startCaption = this.getStartCaption(startDate, endDate, scale);
|
||||
const endCaption = this.getEndCaption(startDate,endDate, scale);
|
||||
if ((endDate.getTime() - startDate.getTime()) < (1.5 * this.unitScales[scale]))
|
||||
return endCaption;
|
||||
return `${startCaption}-${endCaption}`;
|
||||
|
||||
Reference in New Issue
Block a user