Intl.js icon indicating copy to clipboard operation
Intl.js copied to clipboard

formatToParts in browsers (partly) supporting Intl API

Open pkozlowski-opensource opened this issue 8 years ago • 3 comments

Executing new Intl.DateTimeFormat('en-US').formatToParts(new Date())); in a browser that has native Intl API implementation (Chrome, FFox, ...) results in:

TypeError: (intermediate value).formatToParts is not a function

Would it make sense for this polyffill to monkey-patch the Intl object so new methods like formatToParts can be used in browsers already having Intl API partly implemented? Or is this considered gross?

Is using IntlPolyfill a preferred way to go then?

pkozlowski-opensource avatar Dec 19 '16 10:12 pkozlowski-opensource

I guess this is related to #242

pkozlowski-opensource avatar Dec 19 '16 10:12 pkozlowski-opensource

yes, that's correct! any help on that direction will be appreciated :)

caridy avatar Dec 19 '16 15:12 caridy

I'm having some trouble imagining how that would work. Would you have to, like, parse the result you got from the native Intl impl?

icambron avatar May 01 '17 21:05 icambron