Skip to content

fix(frontend): enter a hackathon's start and end as Zurich date and time - #441

Merged
sabinem merged 2 commits into
release/0.13from
hotfix/hackathon-last-day
Nov 19, 2026
Merged

sabinem merged 2 commits into
release/0.13from
hotfix/hackathon-last-day

Conversation

@sabinem

@sabinem sabinem commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  • Organizers: set start and end as date and time, in Zurich time, when creating or editing a hackathon
  • The edit form shows saved values in Zurich time, so saving it unchanged keeps them
  • Times are read as Europe/Zurich on purpose, not in the server's own time zone, which is UTC in the cluster

Left out:

  • Existing hackathons: no data migration. The upcoming hackathon gets its times set by re-saving it in the edit form. Past hackathons keep their old values. Invite links made before the fix keep their old expiry, so revoke them and send new ones.
  • Phases: phase times are still read in the server's time zone (UTC in the cluster), so they are stored an hour off. Phases don't control what anyone can do, so they're left for a separate fix on main.
  • Exact times on hackathon and invitation pages: follow-up on main.

Verified: frontend lint and all tests pass, with new tests for winter time, summer time and both clock-change days.

@marftn marftn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing this, but I think this issue should be solved differently. This PR is patching a symptom rather than fixing the error. The value of endsAt should reflect, as it says, the time when the hackathon ends. It should be equivalent to hackathonClosesAt. What we are doing here is trying to patch in the backend a problem that originates from the frontend sending the wrong time. I see two ways of fixing this:

  • Make endsAt a date instead of a time.Time in the backend, and have in the contract that a hackathon ends at the end of a date.
  • Change the frontend behavior to send the right time instead. If the user chooses December 24, it should send December 25 at 00:00 to the backend (with the zurich time zone). Another option is to let the user select a specific time rather than a date.

The first solution would require some db migration in the backend, and the second one would require changing the already-created hackathons end date, either manually (as it's exceptional and affecting only one hackathon at the moment) or with some migration as well. The expires_at value of the invites should also be fixed, because it was defaulted from endsAt.

I'd prefer the second option (fixing it in the frontend), as it allows more flexibility for the end time.

@sabinem

sabinem commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

@marftn Good catch, I will do the second option then and fix the timezone in the frontend.

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.
@sabinem
sabinem force-pushed the hotfix/hackathon-last-day branch from 520248e to 3824c74 Compare November 19, 2026 15:07
@sabinem
sabinem changed the base branch from main to release/0.13 November 19, 2026 15:27
@sabinem
sabinem requested a review from marftn November 19, 2026 15:28
@sabinem sabinem changed the title fix(backend): keep a hackathon open for the whole of its last day fix(frontend): enter a hackathon's start and end as Zurich date and time Nov 19, 2026
@sabinem
sabinem merged commit 72b0166 into release/0.13 Nov 19, 2026
4 checks passed
@sabinem
sabinem deleted the hotfix/hackathon-last-day branch November 19, 2026 15:59
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.

2 participants