Show in-progress events on home and events pages

Filter by endDate instead of startDate so events stay listed until they finish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 14:46:04 +02:00
co-authored by Claude Opus 5.5
parent 2cf4aa79a1
commit 84ae0dbc55
3 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ export default async function EventsPage() {
const now = Date.now();
const upcoming = (events || []).filter(e => {
if (e.cashupStatus === "closed") return false;
const t = new Date(e.startDate).getTime();
const t = new Date(e.endDate || e.startDate).getTime();
return !isNaN(t) && t > now;
});
const sorted = [...upcoming].sort((a, b) => new Date(a.startDate).getTime() - new Date(b.startDate).getTime());
+1 -1
View File
@@ -45,7 +45,7 @@ export default async function HomePage() {
]);
const now = Date.now();
const upcoming = (events || []).filter(e => {
const t = new Date(e.startDate).getTime();
const t = new Date(e.endDate || e.startDate).getTime();
return !isNaN(t) && t > now;
});
const sorted = [...upcoming].sort((a, b) => new Date(a.startDate).getTime() - new Date(b.startDate).getTime());