Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Conversation

@Tasyp
Copy link
Contributor

@Tasyp Tasyp commented Feb 22, 2020

Fixes #36, #37

Background: If you try to format some date with timezone which is not supported by the browser (e.g. CET on Chrome) but is supported by the polyfill, code throws Intl.DateTimeFormat.prototype.formatToParts called on incompatible receiver. This error happens rarely because modern browsers usually provide data for all timezones and they are only ones who care about correct call receiver (that's why it doesn't happen in IE11).

Reason: Polyfill doesn't inherit native class correctly.

Solution: In Babel, it was fixed in this PR. I've tweaked the code a bit to support IE 10.

Environment to reproduce the issue (NB: It should be opened in Chrome): https://jsfiddle.net/t4q5xk0m/

@markandey markandey merged commit 507fd28 into formatjs:master Feb 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intl.DateTimeFormat.prototype.formatToParts called on incompatible receiver

2 participants