web/storagenode: charts on first day of the month updated (#3219)

This commit is contained in:
Vitalii Shpital 2019-10-10 15:08:48 +03:00 committed by GitHub
parent 9cbb0c4374
commit ca0f749428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,6 +50,10 @@ export class ChartUtils {
daysDisplayed[i] = date.toLocaleDateString('en-US', {day: 'numeric'});
}
if (daysDisplayed.length === 1) {
daysDisplayed.unshift('0');
}
return daysDisplayed;
}
@ -80,6 +84,11 @@ export class ChartUtils {
bandwidthChartData[i] = BandwidthUsed.emptyWithDate(date);
}
if (bandwidthChartData.length === 1) {
bandwidthChartData.unshift(BandwidthUsed.emptyWithDate(1));
bandwidthChartData[0].intervalStart.setUTCHours(0, 0, 0, 0);
}
return bandwidthChartData;
}
@ -110,6 +119,11 @@ export class ChartUtils {
storageChartData[i] = Stamp.emptyWithDate(date);
}
if (storageChartData.length === 1) {
storageChartData.unshift(Stamp.emptyWithDate(1));
storageChartData[0].intervalStart.setUTCHours(0, 0, 0, 0);
}
return storageChartData;
}
}