From 03792fa84c655d5090af096a8be82b5444b52bd0 Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Wed, 30 Apr 2025 18:49:59 +0100 Subject: [PATCH] Get data for the last day of the month for usage graphs --- apps/webapp/app/utils/graphs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/webapp/app/utils/graphs.ts b/apps/webapp/app/utils/graphs.ts index 6220714547..6f0e39730e 100644 --- a/apps/webapp/app/utils/graphs.ts +++ b/apps/webapp/app/utils/graphs.ts @@ -8,7 +8,7 @@ type Options = { export function createTimeSeriesData({ startDate, endDate, window = "DAY", data }: Options) { 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);