question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intl.DateTimeFormat not polyfilled correctly and always flag crashes Firefox

See original GitHub issue

Bug 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 and formatRangeToParts to be polyfilled when requesting the polyfill for a browser that has parts of Intl.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

Screenshot 2021-03-10 at 11 17 54

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
JakeChampioncommented, Mar 10, 2021

@JakeChampion do you still need me to look at anything?

I don’t think so, @romainmenke helped solve this 😄

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found