feat: add timezone selector and fix timezone conversion bug - #127
Merged
Railly merged 1 commit intoMay 25, 2026
Merged
Conversation
Contributor
|
@webtaken is attempting to deploy a commit to the Crafter Station Team on Vercel. A member of the Team first needs to authorize it. |
Add a LATAM timezone selector to the event creation and edit form. Convert event-local date inputs with fromZonedTime before storing UTC timestamps. Pre-fill edit form date and time values in the event timezone instead of the browser timezone.
Railly
force-pushed
the
webtaken/timezone-selector-fix
branch
from
May 25, 2026 18:42
d260d38 to
7aeaf03
Compare
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.
Summary
SearchableSelectBug Details
When creating an event with a non-default timezone, dates were stored incorrectly. The form sent bare datetime strings (e.g.
2026-03-28T22:45) whichnew Date()parsed in the server's local timezone instead of the event's selected timezone.Example: Creating an event at 10:45 PM Buenos Aires (ART, UTC-3):
2026-03-29T01:45:00Z(22:45 + 3h)2026-03-29T03:45:00Z(parsed as server timezone UTC-5 instead)This caused the detail page to show "domingo 29 de marzo, 12:45 AM (ART)" instead of the correct "sábado 28 de marzo, 10:45 PM (ART)", and the countdown to display ~4h 52m instead of ~2h 52m.
Fix
Use
fromZonedTime()fromdate-fns-tzto properly convert local event times to UTC before storage, in bothcreateEventandupdateEventflows.Files Changed
lib/event-utils.ts— ExportTIMEZONE_ABBRSat module level, addTIMEZONE_OPTIONSlib/actions/events.ts— UsefromZonedTime()for date conversion increateEventcomponents/org/creation/org-event-form-minimal.tsx— Add timezone selector, usefromZonedTime()in edit modeTest plan
bun run buildpasses🤖 Generated with Claude Code