Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(www): stop on-demand mdx events from winning the events marquee (#48264)

shaziyab6e574e5cd46
diff --git a/apps/www/lib/events.ts b/apps/www/lib/events.ts
index 72f5db708ab..d5cda293d00 100644
--- a/apps/www/lib/events.ts
+++ b/apps/www/lib/events.ts
@@ -269,10 +269,15 @@ function getAllParsedMdxEvents(): SupabaseEvent[] {
/**
* Read all events under `_events/` and return today-and-future events.
* Past events are excluded (by end_date when present, otherwise start date).
+ * Events already flipped to `onDemand: true` are excluded too — they've
+ * already happened and belong in the on-demand bucket (getOnDemandMdxEvents),
+ * not the upcoming one, regardless of how their UTC-converted date compares to today.
*/
export const getMdxEvents = (): SupabaseEvent[] => {
const today = startOfTodayUtc()
- return getAllParsedMdxEvents().filter((event) => new Date(event.end_date ?? event.date) >= today)
+ return getAllParsedMdxEvents().filter(
+ (event) => !event.onDemand && new Date(event.end_date ?? event.date) >= today
+ )
}
/** All MDX events with `onDemand: true`, including past recordings. */