Skip to content

Commit 97be375

Browse files
committed
Flip bar chart to newest to oldest
1 parent 9987475 commit 97be375

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

routes/insights.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,14 @@ export class InsightsPageController {
374374
const oldestDate = allDates[0];
375375
const today = new Date().toISOString().split("T")[0];
376376

377-
// Generate all dates from oldest to today
377+
// Generate all dates from today to oldest (newest first, left to right)
378378
const dateRange: string[] = [];
379379
if (oldestDate) {
380-
const current = new Date(oldestDate + "T00:00:00");
381-
const end = new Date(today + "T00:00:00");
382-
while (current <= end) {
380+
const current = new Date(today + "T00:00:00");
381+
const end = new Date(oldestDate + "T00:00:00");
382+
while (current >= end) {
383383
dateRange.push(current.toISOString().split("T")[0]);
384-
current.setDate(current.getDate() + 1);
384+
current.setDate(current.getDate() - 1);
385385
}
386386
}
387387

0 commit comments

Comments
 (0)