fix: timezone-aware event sorting and hero priority#22
Merged
radiolabme merged 1 commit intomainfrom Feb 17, 2026
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidates event timestamp logic to use the Temporal polyfill introduced in #20, and fixes hero selection priority.
Changes
event-time.tsthat delegate togetEventTimestampInTimezonefor correct timezone-aware bucketing into current/upcoming/pastindex.astroandevents/index.astroin favor of the shared utilitiesContext
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.