From 29ad1da6e2124617c915c539f4493c56d117da64 Mon Sep 17 00:00:00 2001 From: Regalijan Date: Sun, 10 Mar 2024 00:48:37 -0500 Subject: [PATCH] Don't show passed days on events feed --- app/routes/events-team.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/routes/events-team.tsx b/app/routes/events-team.tsx index 73f34ef..10e8b2b 100644 --- a/app/routes/events-team.tsx +++ b/app/routes/events-team.tsx @@ -48,9 +48,9 @@ export async function loader({ context }: { context: RequestContext }) { const now = new Date(); const monthEventList = await context.env.D1.prepare( - "SELECT answer, approved, created_by, day, details, id, month, pending, performed_at, reached_minimum_player_count, type, year FROM events WHERE month = ? AND year = ? ORDER BY day ASC;", + "SELECT answer, approved, created_by, day, details, id, month, pending, performed_at, reached_minimum_player_count, type, year FROM events WHERE month = ? AND year = ? AND (day >= ? OR pending = 1) ORDER BY day ASC;", ) - .bind(now.getUTCMonth() + 1, now.getUTCFullYear()) + .bind(now.getUTCMonth() + 1, now.getUTCFullYear(), now.getUTCDate()) .all(); if (monthEventList.error)