Description
Across src/app/events/page.jsx, src/app/hackathons/page.jsx, and src/app/projects/page.jsx, the "Spotlight / Featured / Spotlight Project" banner always shows events[0] / hackathons[0] / projects[0] — whatever the backend returned first (typically most-recently-created), with no sorting by eventDate and no filtering to upcoming events.
const filteredEvents = events.filter((e) => { /* search/format/location */ });
const featuredEvent = events[0]; // first element of the raw, unsorted API array
Expected Behavior
Choose the soonest upcoming event (sort by eventDate ascending, optionally filter >= now) before picking the featured item.
Actual Behavior
The most prominent marketing surface of the homepage advertises an arbitrary (and possibly past or arbitrarily-ordered) item as the headline event. Combined with the date-handling bugs, a past date-only event can even render as "yesterday."
Proposed Fix
const now = Date.now();
const featuredEvent = [...events]
.filter((e) => e.eventDate && new Date(e.eventDate).getTime() >= now)
.sort((a, b) => new Date(a.eventDate) - new Date(b.eventDate))[0] || events[0];
References
src/app/events/page.jsx:64
src/app/hackathons/page.jsx:57
src/app/projects/page.jsx:58
Description
Across
src/app/events/page.jsx,src/app/hackathons/page.jsx, andsrc/app/projects/page.jsx, the "Spotlight / Featured / Spotlight Project" banner always showsevents[0]/hackathons[0]/projects[0]— whatever the backend returned first (typically most-recently-created), with no sorting byeventDateand no filtering to upcoming events.Expected Behavior
Choose the soonest upcoming event (sort by
eventDateascending, optionally filter>= now) before picking the featured item.Actual Behavior
The most prominent marketing surface of the homepage advertises an arbitrary (and possibly past or arbitrarily-ordered) item as the headline event. Combined with the date-handling bugs, a past date-only event can even render as "yesterday."
Proposed Fix
References
src/app/events/page.jsx:64src/app/hackathons/page.jsx:57src/app/projects/page.jsx:58