Skip to content

HOLD Pin event times to an explicit per-event time zone - #2074

Draft
maebeale wants to merge 4 commits into
mainfrom
maebeale/event-timezone-question
Draft

HOLD Pin event times to an explicit per-event time zone#2074
maebeale wants to merge 4 commits into
mainfrom
maebeale/event-timezone-question

Conversation

@maebeale

@maebeale maebeale commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 5 Inspect 🔬 changes how every event date/time is interpreted on entry and rendered on the web (form, decorator, helpers, model labels); mailers deliberately stay in the recipient's zone

Goal

Event datetimes were stored zone-lessly and silently interpreted in whoever's session zone — at both entry and display. An event created by a non-Pacific admin shifted by hours for a Pacific viewer, with no canonical "event time." Admins are in mixed zones, so this was a live latent bug (edit wars, wrong times).

Approach

Add events.time_zone — each event carries its own canonical zone, and every event-derived date/time on the web routes through it via Event#event_zone:

  • Entry (build_datetime) parses typed wall-clock times in the event's zone, not the editor's session zone.
  • Form readers re-render in the event's zone so edits round-trip.
  • Web display — decorator, show, application helpers (registration-panel labels, form-header tokens, registration-close default), and model identity labels (start_text, remote_search_label, date_title, day_count) render in the event's zone.
  • New time-zone selector on the event form (US zones prioritized), scoping the date/time cards. The preview refreshes on save — the date/time preview is server-rendered (no live JS), so the zone follows the same way.

Design decisions (from review)

  • No backfill. The column is nullable with no default; existing rows stay NULL and Event#event_zone reads a blank column as Pacific (DEFAULT_TIME_ZONE). New events carry an explicit zone (selector defaults to Pacific).
  • Mailers stay in the recipient's zone (unchanged behavior). EventDecorator#times and the event_dates_detail_label / event_times_label helpers take a zone: override defaulting to the event's zone; mailer templates pass the recipient's zone, so emails read in the reader's local time.

Form selector (rendered): a full-width bar — 🌎 "The times below are in [ Pacific Time ▾ ]" — above the Start / End / Registration-closed cards.

Copilot AI review requested due to automatic review settings August 4, 2026 00:10

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 4, 2026 00:17

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 4, 2026 00:24

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

maebeale and others added 4 commits August 3, 2026 22:24
Event datetimes were stored zone-lessly and interpreted in whoever's
session zone at both entry and display, so an event created by a non-Pacific
admin shifted hours for a Pacific viewer (and vice versa). Add an explicit
events.time_zone so each event carries its own canonical zone; route entry,
form readers, and all display through it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Covers: zone validation, entry parsed in the event's zone (not the
editor's session), form readers rendering in the event's zone, the new
form selector, and updates the create request spec to the new semantics.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sweep the helpers (registration-panel labels, form-header tokens,
reminder subject, registration-close default) and the model identity
labels (start_text, remote_search_label, date_title, day_count) plus
EventRegistration#name off Time.zone and onto the event's own zone, so
no event-derived date/time shifts with the viewer. Update the index
request spec to assert the new no-per-viewer-shift behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Drop the NOT NULL default so existing rows stay NULL (no backfill);
  Event#event_zone reads a blank column as Pacific (DEFAULT_TIME_ZONE),
  and the form selector defaults there.
- Revert mailers to the recipient's time zone. The shared display
  methods (EventDecorator#times and the event_dates_detail/times_label
  helpers) now take a zone: override defaulting to the event's zone;
  mailer templates pass the recipient zone so emails match the user.
- No live-preview JS: the form's date/time preview is server-rendered
  (refreshes on save), so the zone abbreviation follows the same way.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale
maebeale force-pushed the maebeale/event-timezone-question branch from 2062493 to 84b0fad Compare August 4, 2026 02:33
Copilot AI review requested due to automatic review settings August 4, 2026 02:33

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale maebeale changed the title Pin event times to an explicit per-event time zone HOLD Pin event times to an explicit per-event time zone Aug 4, 2026
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