Skip to content

Draft: feat(datetime): label BC time PCT instead of tzdata's MST - #60

Open
xcompass wants to merge 1 commit into
ubcfrom
feat/bc-pct-label
Open

xcompass wants to merge 1 commit into
ubcfrom
feat/bc-pct-label

Conversation

@xcompass

Copy link
Copy Markdown
Member

BC has stayed on UTC-7 since 2026-03-08. With DateTime::TimeZone 2.71 (#59), dates from 2026-11-01 show as e.g. "December 1, 2026, 11:59:00 PM MST", tzdata's label. BC's official abbreviation is PCT (Pacific Time; BC Citizens' Services news release 2026CITZ0009-001073, 2026-09-17). This PR shows PCT instead.

How

  • New dependency-free WeBWorK::Utils::TimeZoneLabels maps America/Vancouver + tzdata MST → PCT.
  • formatDateTime passes its output through it, using the abbreviation tzdata gives for that instant. Every server-rendered zone label goes through formatDateTime, so nothing else needs changing.
  • parseDateTime accepts PCT. Without that, exported set definition files (12/01/2026 at 11:59pm PCT) would import with a "Time zone 'PCT' not recognized" warning and fall back to the course zone.

What does not change

  • July 2026 stays PDT, Dec 2025 stays PST.
  • Other zones tzdata labels MST keep it: Phoenix, Dawson Creek, Edmonton (Edmonton shows CST from 2026-11-01).
  • datetime_format_short has no zone. datetime_format_full prints the zone name.

Tests

  • t/time_zone_labels.t: 16 cases. prove t passes all 53 in perl:5.38.
  • Ran the patched modules in a webwork-verf pod (v2.20.9, DTTZ 2.71):
dec 2026 long, Vancouver           December 1, 2026, 11:59:00 PM PCT
dec 2026 long, Canada/Pacific      December 1, 2026, 11:59:00 PM PCT
dec 2026 long, local               December 1, 2026, 11:59:00 PM PCT
dec 2026 long, Vancouver, fr-CA    1 décembre 2026, 23 h 59 min 00 s PCT
dec 2026 setdef, Vancouver         12/01/2026 at 11:59pm PCT
jul 2026 long, Vancouver           July 14, 2026, 11:59:00 PM PDT
dec 2025 long, Vancouver           December 31, 2025, 11:59:00 PM PST
dec 2026 long, Phoenix             December 1, 2026, 11:59:00 PM MST
round trip '12/01/2026 at 11:59pm PCT' (display America/New_York) -> 1796194740 OK
parse '12/01/2026 at 11:59pm MST' -> 1796194740 OK
warnings: none

Release: tag v2.20.10, pin it in configuration and ship it with CHG0103333 (prod, 2026-10-26), which already carries v2.20.9.

  • Staging: the probe in a v2.20.10 pod shows PCT.
  • Staging: export and re-import a set definition file.

BC has stayed on UTC-7 since 2026-03-08. DateTime::TimeZone 2.68+ labels
America/Vancouver "MST" from 2026-11-01, but BC's official abbreviation is
PCT (Pacific Time; BC news release 2026CITZ0009-001073, 2026-09-17).

formatDateTime now swaps the tzdata abbreviation for the official one via
WeBWorK::Utils::TimeZoneLabels, only for America/Vancouver and only where
tzdata says MST: summer 2026 stays PDT, earlier winters PST, and other MST
zones (Phoenix, Dawson Creek) are untouched. parseDateTime accepts PCT, so
exported set definition files ("12/01/2026 at 11:59pm PCT") import back to
the same time.
@xcompass xcompass changed the title feat(datetime): label BC time PCT instead of tzdata's MST Draft: feat(datetime): label BC time PCT instead of tzdata's MST Oct 23, 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.

1 participant