Skip to content

Commit 76278b5

Browse files
fix: wrong yesterday range
Signed-off-by: Henry Gressmann <[email protected]>
1 parent e48d19c commit 76278b5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

web/src/api/ranges.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ export const ranges: Record<RangeName, () => { range: DateRange; dataPoints: num
4444
return { range: { start, end }, dataPoints: hours + 1, graphRange: "hour" };
4545
},
4646
yesterday: () => {
47-
const end = startOfDay(new Date());
48-
const start = subDays(end, 1);
49-
return { range: { start: start.getTime(), end: addHours(end, 1).getTime() }, dataPoints: 25, graphRange: "hour" };
47+
const now = new Date();
48+
const start = addHours(startOfDay(subDays(now, 1)), 1).getTime();
49+
const end = addHours(endOfDay(subDays(now, 1)), 1).getTime();
50+
return { range: { start: start, end }, dataPoints: 24, graphRange: "hour" };
5051
},
5152
last7Days: () => ({ range: lastXDays(7), dataPoints: 7, graphRange: "day" }),
5253
last30Days: () => ({ range: lastXDays(30), dataPoints: 30, graphRange: "day" }),

web/src/pages/p/[...project].astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const getStaticPaths = (() => {
99
{ params: { project: "project" } },
1010
{ params: { project: "private-project" } },
1111
{ params: { project: "public-project" } },
12+
{ params: { project: "liwan.dev" } },
1213
];
1314
}) satisfies GetStaticPaths;
1415
---

0 commit comments

Comments
 (0)