New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formatting of relative and absolute dates using Intl.* APIs #14173
base: development
Are you sure you want to change the base?
Conversation
app/jest.unit.config.js
Outdated
transformIgnorePatterns: ['node_modules/(?!(@github))'], | ||
transformIgnorePatterns: [ | ||
'node_modules/(?!(@github|bcp-47|is-decimal|is-alphabetical|is-alphanumerical))', | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:its-true-all-of-it:
@sergiou87 Merge conflict, need a little ✅ again please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Sergio Padrino <sergio.padrino@gmail.com>
en-US-POSIX gives us something very close to the standard behavior of number.toString() et al, i.e. an invariant culture
Alright, after significant investigation here we've determined that we're not quite ready to jump on the regional-aware train just yet. There are some notable en-* locales that isn't defined in the Unicode Common Locale Data Repository such as en-ES, en-NO, en-FR, etc. We have ideas for how to address this though and in the meantime we'll be using the Given the recent discoveries I'm moving the feature flag back to @sergiou87 Another look when you've got time please? |
Co-Authored-By: tidy-dev <75402236+tidy-dev@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and works good!
ff54971
to
9548385
Compare
Closes #13943
Description
This adds
region-awareformatting for relative and absolute dates using theIntl
namespace. This builds on #14149, #14123 and app.getLocaleCountryCodeNote that this is not about localizing strings, the interface will remain US-english,
it will however apply the correct (hopefully) regional settings for formatting numbers. Most notably right now this means that users like myself who have their OS configured to display 24-hour format will now.Note that this is feature-flagged and currently only enabled for dev.
cc @tsvetilian-ty as author of #13965
Screenshots
For reference these are my regional settings on Windows and macOS (they resolve to
en-SE
on both platforms)Release notes
Notes: