Skip to content

Keep a picked time inside the device's DST gap - #56

Merged
byteful merged 3 commits into
mainfrom
fix/device-dst-gap-time
Oct 1, 2026
Merged

byteful merged 3 commits into
mainfrom
fix/device-dst-gap-time

Conversation

@byteful

@byteful byteful commented Sep 24, 2026

Copy link
Copy Markdown
Member

What changed

On a phone or browser set to US time, picking 2:30 AM on the night the US clocks spring forward saved the event at 3:30 AM, even when the event's own time zone has a 2:30 that night (Arizona, for example). The picked time is now kept everywhere it is set, loaded or shown. For an event in the device's own zone, the form now says the time doesn't exist instead of quietly moving it. Web and mobile.

Before you start

  • Where: local (dev/run.sh api, then dev/run.sh web or the mobile dev client), or staging after merge (civfix.dev / the TestFlight build)
  • Device time zone: Los Angeles or any other US zone that changes its clocks. Web: Chrome DevTools → More tools → Sensors → Location → Timezone ID America/Los_Angeles, then reload. iPhone: Settings → General → Date & Time. Android: Settings → System → Date & time.
  • Sign in as: citizen (reviewer login)
  • Test date: Sunday, March 14, 2027, the next US spring-forward night (you can't pick a date in the past)

Verify

[Web]

  1. Open your avatar ("Open profile") → "Event dashboard" → "Create"
  2. Type a title and click "Next"
  3. On "When is it?", under "Date and time", click "Change" next to "Times in …", type "Phoenix" in "Search time zones", and pick America/Phoenix
  4. Set the date to Sun, Mar 14, 2027
  5. Set "Starts" to 2:30 AM — Expect: "Starts" stays at 2:30 AM with no error, and "Ends" fills in at 4:30 AM
  6. Click "Next" through the remaining steps to "Ready to publish?" — Expect: the "When" row reads Sun, Mar 14, 2:30 AM, and the time range under it starts at 2:30 AM
  7. If "Announce to the feed" is on, look at its preview card — Expect: it shows Sun, Mar 14, 2:30 AM
  8. Click "Publish event" — Expect: the event page shows Mar 14 · 2:30 AM – 4:30 AM
  9. Go back to "Event dashboard", open the event's actions menu, and click "Edit" — Expect: "Starts" shows 2:30 AM and the time zone is Phoenix
  10. Click "Save changes" without changing anything — Expect: the event page still shows 2:30 AM
  11. On "Event dashboard", open the event's actions menu and click "Duplicate" — Expect: the "Duplicate event" sheet shows "Starts" as 2:30 AM
  12. Click "Create copy" — Expect: "Copy created", and the copy's edit screen shows "Starts" as 2:30 AM
  13. Create another event, leave the time zone on your device's zone, set the date to Mar 14, 2027 and "Starts" to 2:30 AM — Expect: under "Starts": "That time doesn't exist on this date because the clocks jump forward. Pick another time." and "Next" stays disabled

[Mobile]

  1. Tap your avatar ("Open profile") → "Event dashboard" → "Create"
  2. Type a title and tap "Next"
  3. Tap "Change" next to "Times in …", search "Phoenix", and pick America/Phoenix
  4. Set the date to Mar 14, 2027
  5. With "Starts" still empty, tap it and pick 2:30 AM — Expect: "Starts" shows 2:30 AM
  6. Tap "Starts" again and pick 2:45 AM — Expect: "Starts" shows 2:45 AM
  7. Tap "Next" through to "Ready to publish?" — Expect: the "When" row reads Sun, Mar 14, 2:45 AM
  8. Tap "Publish event" — Expect: the event page shows 2:45 AM
  9. Open "Event dashboard", open the event's actions menu, and tap "Edit" — Expect: "Starts" shows 2:45 AM
  10. Create another event in your device's zone for Mar 14, 2027 and pick 2:30 AM — Expect: "That time doesn't exist on this date because the clocks jump forward. Pick another time." under "Starts"

Regression

Setting a time on an ordinary day — [Web] [Mobile]

  1. Create an event dated Oct 15, 2026 and set "Starts" to 10:00 AM — Expect: "Ends" fills in at 12:00 PM
  2. Under "Runs for", tap "3 h" — Expect: "Ends" shows 1:00 PM and "3 h" is selected
  3. Change the date to Oct 20, 2026 — Expect: "Starts" stays at 10:00 AM and "Ends" at 1:00 PM
  4. Change the date to Sun, Nov 7, 2027 (the US fall-back night) — Expect: the times still don't change
  5. Publish — Expect: the event page shows Nov 7 · 10:00 AM – 1:00 PM

Past times today are blocked — [Web] [Mobile]

  1. Create an event dated today and set "Starts" to an hour ago — Expect: "Pick a time that hasn't passed yet." and "Next" stays disabled

Editing an event in another time zone — [Web] [Mobile]

  1. Open an upcoming event whose "Times in …" zone differs from your device's, then click "Edit" — Expect: "Starts" and "Ends" match the times on the event page
  2. Change only the title and click "Save changes" — Expect: the event page's times don't change

Duplicating an event — [Web] [Mobile]

  1. On "Event dashboard", open a past event's actions menu and click "Duplicate" — Expect: "Starts" shows the original start time
  2. Click "Create copy" — Expect: "Copy created", and the copy opens with that start time

Shift times in sign-up slots — [Web] [Mobile]

  1. For an event from 9:00 AM to 1:00 PM, on "Who do you need?" click "Add a slot", then "Set a time"
  2. Set "Starts" to 10:00 AM and "Ends" to 11:00 AM — Expect: accepted
  3. Set "Starts" to 8:00 AM — Expect: "Shifts must fit inside the event's hours."

Not covered

  • On the spring-forward night, the "Runs for" chips still add hours by the device clock. That is unchanged here.
  • Devices in zones whose clocks jump at midnight (Chile, Cuba) are covered by automated tests only.

@byteful
byteful merged commit 8f5b5fb into main Oct 1, 2026
3 checks passed
@byteful
byteful deleted the fix/device-dst-gap-time branch October 1, 2026 04:05
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