Skip to content

Timezone controls (optional, default turned off), cleaned version - #1405

Merged
fbacall merged 24 commits into
ElixirTeSS:masterfrom
cwant:cwant/timezone-controls-clean
Nov 24, 2026
Merged

fbacall merged 24 commits into
ElixirTeSS:masterfrom
cwant:cwant/timezone-controls-clean

Conversation

@cwant

@cwant cwant commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Note: See previous PR #1327 for the initial version of this pull request.
This version cherry-picks all of the changes from the previous one, but fixes the merge conflicts that the previous version suffered from over time.

===============

Summary of changes

This ports over the timezone controls from Explora to Elixir/TeSS.

Motivation and context

It's helpful to see events in your own timezone. This PR gives a toggle between showing times in the timezone of each event, and showing times in the timezone detected by the webbrowser.

The timezone control widget shows up on any page where there is an event listed (e.g. events#index, events#show, upcoming events, etc.).

The timezone controls can be opened and closed for visibility.

An added feature: the event edit page allows you to enter times in the timezone of the event (rather than having to do the mental math of entering it in GMT and hoping you've done that correctly).

Note : this uses the ffi-icu gem. For our TeSS we use this so that the timezone names appear in the language that is selected in our user interface. E.g. heure d’été du Pacifique nord-américain when French is selected instead of Pacific Daylight Time.

Screenshots

Here is the initial hit on event#index, with option "event timezones" selected by default. Two events with different timezones are shown.

timezones1

Here is the same page, with the timezones controls displayed via the Change... link. (Clicking the x hides the controls again.)

timezones2

Here is the page with my timezone (detected by the browser) is clicked:

timezones3

Here is the editing link for start/end times, done in the timezone selected for the event (converted to GMT when saved to the database):

timezones4

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree to license it to the TeSS codebase under the BSD license.

cwant added 24 commits November 24, 2026 10:41
…zone override.

(Part 1 of timezone controls.)
(Part 4 of timezone controls.)
Also, localize dates for longer events.
(Part 7 of timezone controls.)
… specified time zone.

(Otherwise they have to do mental math to add times in GMT.)
…erant.

The specific implementation suggested by Co-pilot gave incorrect values though.
Switching <i> to <button> changes the visual look, but is probably fine.
Get the url (created with a route helper) from a data property instead.
(base it on the start/end of the event, not the time right now).
This ensures that the timezone detected by the browser doesn't
change in winter months.
@fbacall
fbacall merged commit 23ab3f8 into ElixirTeSS:master Nov 24, 2026
7 of 8 checks passed
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