formatjs / dust-intl

Dust helpers for internationalization.
http://formatjs.io/dust/
Other
48 stars 11 forks source link

intlDate/formatDate fails on IE8 when passing in ISO date format #38

Closed lalau closed 9 years ago

lalau commented 10 years ago

On IE8, this call returns NaN for ISO date format. The call is made as new Date('2014-09-19T20:37:21Z').getTime(). It seems IE8 does not recognize this format, while newer IE and other browsers work for these. I would expect a polyfill to handle this case.

caridy commented 10 years ago

IE8 is one of the targeted browsers. We will investigate this in more details.

caridy commented 10 years ago

/cc @juandopazo

juandopazo commented 10 years ago

Is there a sensible approach to polyfilling this? I'm tempted to require numbers or Date objects.

ericf commented 9 years ago

We're not going to change or add the date parsing features built into the runtime. If IE8 can't parse the ISO string into a valid Date instance, then it won't work. If you're stuck with ISO dates in your DB or something, then you might want to find a lib that can parse them into valid Date instances before passing them o the helper.