Intl.DateTimeFormat not polyfilled correctly and always flag crashes Firefox
See original GitHub issueBug report
The Intl.DateTimeFormat
polyfill doesn’t correctly detect support for formatRange
in Firefox (86). That browser doesn’t support formatRange
and formatRangeToParts
but also doesn’t receive the polyfill by default.
If the always
flag is passed to force the polyfill Firefox will report an error Uncaught TypeError: Setter must be a function
coming from the polyfill script.
Expected behaviour
formatRange
andformatRangeToParts
to be polyfilled when requesting the polyfill for a browser that has parts ofIntl.DateTimeFormat
.always
flag not to cause an error
Steps to reproduce
- Request the Intl.DateTimeFormat polyfill and the
en
locale (with/without|always
) in Firefox
Environment
- Firefox 86
- MBP, macOS Big Sur
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Intl.DateTimeFormat does not format time in accordance with ...
Testing this in Firefox 66 works as expected. I get the same values in Chrome and Firefox of "4:00 PM" for Pacific Time....
Read more >Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
The Intl.DateTimeFormat.prototype.resolvedOptions() method returns a new object with properties reflecting the locale and date and time formatting options ...
Read more >Quicktext No Longer Displays after Upgrade to Version 56.0b2 ...
I sure can use your code, just want to understand the difference. Isn't "Intl.DateTimeFormat" the way to go? What is "mozIntl"?
Read more >1289340 - Expose Intl.DateTimeFormat.prototype.formatToParts
DateTimeFormat.prototype.formatToParts. https://reviewboard.mozilla.org/r/78426/#review77040 The XXX bug you mention claims I'm module owner (which I am not), ...
Read more >System date and time formats are not respected (all platforms)
I run TB nightlies. The 2016-10-27 nightly *does* respect the date and time format settings. The next nightly that I tried was 2017-01-14,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think so, @romainmenke helped solve this 😄
Chrome supports it, but from
76
So this should work : https://github.com/Financial-Times/polyfill-library/pull/1013/commits/4ca7ff2a1474daea8bbf59c0f0d40a6c37fafdf4#diff-77edc5e4fe23dd90eb39468935b117d0add719ecfc03b83473a1980568198b9eR39