Localize time formatting with Intl.DateTimeFormat#113
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".
|
Hi @ggaabe, could you have a look? We're just waiting for those two PRs to migrate from rrule.js to your library 🙏 |
|
lgtm 👍 I think it might just need a rebase on main, as there have been recent changes (the build is currently failing). |
4aaddb1 to
b98187e
Compare
|
rebased 👍 |
b98187e to
3ddfb23
Compare
|
@ggaabe it seems the issue with the formatting difference between my local env and the CI is still there: https://github.com/ggaabe/rrule-temporal/actions/runs/23905071509/job/69711571666 |
|
Sorry @borisgraeff-pxo, I didn't see your comment before suggesting #120. That said, I think it fits with what you're suggesting. @ggaabe, what do you think? |
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)