Localize time formatting with Intl.DateTimeFormat#113
Localize time formatting with Intl.DateTimeFormat#113borisgraeff-pxo wants to merge 6 commits intoggaabe:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f3f87a30c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52c69d4f10
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Why
Time strings generated by
toTextwere always formatted with an English-style 12-hour clock (AM/PM), even when the specified locale was not English.This PR makes time rendering locale-aware so generated recurrence descriptions are consistent with the selected language.
What Changed
src/totext.tsto useIntl.DateTimeFormatwith the resolved locale.formatTimeto:Temporal.ZonedDateTime),hour/minute/secondcombinations throughIntl,tzAbbreviation) to use locale-awareIntl.DateTimeFormatfallback behavior.toTexttime rendering path to pass locale + timezone context when formattingbyHour/byMinute/bySecond.Tests
Updated i18n expectations in:
src/tests/totext.i18n.test.tssrc/tests/totext.i18n.extra.test.tsExpected outputs now reflect locale-specific time conventions:
17:30instead of5:30 PM)GMT-4, localized variants instead of fixedEDT/CST)