Skip to content

fix: timezone-aware event sorting and hero priority#22

Merged
radiolabme merged 1 commit intomainfrom
feb-meeting-online-only
Feb 17, 2026
Merged

fix: timezone-aware event sorting and hero priority#22
radiolabme merged 1 commit intomainfrom
feb-meeting-online-only

Conversation

@radiolabme
Copy link
Collaborator

Consolidates event timestamp logic to use the Temporal polyfill introduced in #20, and fixes hero selection priority.

Changes

  • getEventStartMs / getEventEndMs — new helpers in event-time.ts that delegate to getEventTimestampInTimezone for correct timezone-aware bucketing into current/upcoming/past
  • Current events sort by end time — short-lived events (tonight's meeting) outrank long-running background events (month-long DXpedition)
  • Hero selection prefers current over upcoming — a featured event happening right now takes the hero slot over a future featured event
  • Removed duplicate inline logic from both index.astro and events/index.astro in favor of the shared utilities

Context

The previous inline implementations used Date.setHours() which operates in the server's local timezone, causing events to land in the wrong bucket when the build server's timezone differs from the event's timezone. This was the same root cause as #12 but in additional code paths.

- Add getEventStartMs/getEventEndMs helpers that delegate to
  getEventTimestampInTimezone (Temporal polyfill) for correct
  timezone-aware bucketing of events into current/upcoming/past
- Sort current events by end time so short-lived events (tonight's
  meeting) take priority over long-running background events
- Prioritize featured current events over featured upcoming events
  in homepage hero selection
- Remove duplicate inline timestamp logic from both listing pages
  in favor of shared utilities in event-time.ts
@radiolabme radiolabme merged commit 5b5c0af into main Feb 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant