Repository navigation
fix(frontend): enter a hackathon's start and end as Zurich date and time - #447
Merged
Merged
Conversation
The create and edit forms offered a date only, and the server action
parsed it with `new Date("2026-11-13")`, which is 00:00 UTC. `ends_at` is
the moment the backend closes a hackathon, so every hackathon closed at
01:00 Zurich time on its own last day: Join and Leave were refused,
invite links defaulting to `ends_at` expired, and a one-day hackathon
went straight from PENDING to FINISHED. "From Bits to Breakthroughs 2026"
(2026-11-13) hit exactly this.
Both forms now take a date and a time, read explicitly as Europe/Zurich
by `$lib/utils/eventTime` — not by `new Date()`, which on the server
reads a bare date-time in the container's UTC clock. The edit form shows
stored values on the same clock, so saving it unchanged keeps them, and
`ends_at` stays what it says: the moment the hackathon ends.
Hackathons and invites created before this keep their midnight-UTC
values; they are corrected by a one-off SQL update, not by this commit.
(cherry picked from commit 323278d)
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.
Hackathons close when organizers say they do
Before: organizers could only pick a date, which was saved as midnight UTC. Every hackathon therefore closed at 01:00 on its last day. During "From Bits to Breakthroughs 2026", a one-day event on 13 November, nobody could join, invite links had expired, and the event showed as finished all day. Now organizers pick a date and a time in Zurich time, and the hackathon closes exactly then.
Left out:
main.main.Verified: frontend lint and all tests pass, with new tests for winter time, summer time and both clock-change days.