Get data for the last day of the month for usage graphs (#1999)

This commit is contained in:
Matt Aitken
2025-05-01 09:53:06 +01:00
committed by GitHub
parent cb47200d34
commit af019473cd
+1 -1
View File
@@ -8,7 +8,7 @@ type Options<R> = {
export function createTimeSeriesData<R>({ startDate, endDate, window = "DAY", data }: Options<R>) {
const outputData: Array<{ date: Date; value?: R }> = [];
const periodLength = periodLengthMs(window);
const periodCount = Math.floor((endDate.getTime() - startDate.getTime()) / periodLength);
const periodCount = Math.round((endDate.getTime() - startDate.getTime()) / periodLength);
for (let i = 0; i < periodCount; i++) {
const periodStart = new Date(startDate);