Skip to content

fix(events): show and require the time zone picker when the browser reports none - #420

Merged
tompscanlan merged 1 commit into
mainfrom
fix/timezone-required-when-browser-has-none
Sep 30, 2026
Merged

tompscanlan merged 1 commit into
mainfrom
fix/timezone-required-when-browser-has-none

Conversation

@tompscanlan

Copy link
Copy Markdown
Contributor

Problem

An organizer could not publish a new event. Every Publish failed with a 422 and the toast "timeZone must be a string".

Their browser gives the page no time zone. Chrome returns undefined from Intl.DateTimeFormat().resolvedOptions().timeZone when the operating system's time zone is one ICU cannot canonicalize. The form takes its default zone from that value, so it starts with none. The time zone picker only rendered when a zone was already set, so it was hidden. Publish then sent a create with no timeZone, the API rejected it, and the user had no field to fix.

Change

  • DatetimeComponent renders the time zone picker whenever showTimeZone is set, even with no zone.
  • The picker has a required rule, so Publish stops with "Choose a time zone" instead of sending a request the API will refuse.
  • Nothing changes when the browser does report a zone. The picker shows the same default as before.

Tests

  • DatetimeComponent.vitest.spec.ts: with no browser zone, the picker renders, requires a value, and emits the chosen zone. It stays hidden when showTimeZone is false.
  • EventFormBasicComponent.vitest.test.ts: with no browser zone, Publish does not call create. After a zone is chosen, create is sent with it. This test fails without the fix.
  • The full unit suite has the same 43 failures in 5 files as main (calendar, profile form, date formatting, group events page). None of them come from this change. vue-tsc and eslint are clean.

…eports none

Chrome's Intl.DateTimeFormat().resolvedOptions().timeZone is undefined when
the operating system's time zone is one ICU cannot canonicalize. The form
then starts with no time zone, the picker hides itself because it rendered
only when a zone was already set, and Publish sends a create with no
timeZone. The API rejects that with a 422 ("timeZone must be a string"),
and the user has no field they can fix.

Render the picker whenever showTimeZone is set, and give it a required rule,
so the form stops at Publish with "Choose a time zone" instead of sending a
request the API will refuse.
@tompscanlan
tompscanlan merged commit 46e2186 into main Sep 30, 2026
3 checks passed
@tompscanlan
tompscanlan deleted the fix/timezone-required-when-browser-has-none branch October 1, 2026 17:37
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