Skip to content

Use the hour cycle of the locale in timestamps - #5920

Merged
Eugene (OEvgeny) merged 2 commits into
mainfrom
OEvgeny/fix-date-formatter-hour-cycle
Oct 19, 2026
Merged

Eugene (OEvgeny) merged 2 commits into
mainfrom
OEvgeny/fix-date-formatter-hour-cycle

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Timestamps and their "Sent at" screen reader text use the 12-hour clock in every language, such as "Gesendet um 19. Oktober um 11:06 AM" in German.

Changelog Entry

Fixed

  • Fixed timestamps always using the 12-hour clock, such as "4:41 PM" instead of "16:41" in German, in PR #5920, by @OEvgeny

Description

useDateFormatter used the Globalize skeleton MMMMdhm, where h forces the 12-hour clock. It now uses MMMMdjm, where j is the preferred hour cycle of the locale, so English stays "August 8 at 4:41 PM" and German becomes "8. August um 16:41".

Design

  • Kept Globalize and the precompiled formatters: CLDR j is supported by the bundled data, no switch to Intl.DateTimeFormat needed.

Specific Changes

  • useDateFormatter.ts, createPrecompiledGlobalize.mjs, types/PrecompiledGlobalize.ts: skeleton MMMMdhm → MMMMdjm

  • timestamp/absolute.hourCycle.html: snapshot 1, "August 8 at 4:41 PM" in en-US; snapshot 2, "8. August um 16:41" in de-DE; asserts the visible and "Sent at" texts

  • localization.fileUpload.polish.html: snapshot 1 updated, "6 września 8:49 PM" → "20:49"

  • I have added tests and executed them locally

  • I have updated CHANGELOG.md

  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Eugene Olonov added 2 commits October 19, 2026 13:33
The date formatter used the Globalize skeleton "MMMMdhm", where "h" forces the
12-hour clock in every locale (e.g. "8. August um 4:41 PM" in German). Use "j",
the preferred hour cycle of the locale.
@OEvgeny
Eugene (OEvgeny) marked this pull request as ready for review October 19, 2026 21:37
Copilot AI balanced review requested due to automatic review settings October 19, 2026 21:37

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.

@OEvgeny
Eugene (OEvgeny) merged commit 14853fc into main Oct 19, 2026
32 checks passed
@OEvgeny
Eugene (OEvgeny) deleted the OEvgeny/fix-date-formatter-hour-cycle branch October 19, 2026 22:00
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.

3 participants