Angular2 date pipe not working in iOS

i’ve some data with a date string in ISO format like “YYYY-MM-DDTHH:mm:ss.sssZ”

When i use the date pipe of angular2 :

{{ | date:"dd/MM/yyyy HH:mm"}}

My App in iOS crash (but not in the browser).

Someone has the same problem ?

Thanks for your help,

I would recommend rolling your own pipe using moment. The JavaScript i18n API is pretty braindead, IMHO.

Hi, thanks for your help.
Finally, i find the solution :
in my index.html, i add options to polyfills


then, in my app.module.ts i import

import ‘intl’;
import ‘intl/locale-data/jsonp/en’;

And the date is displayed correctly without errors in iOS :slight_smile:


After importing
import ‘intl’;
import ‘intl/locale-data/jsonp/en’;
in app.module.ts
is there any other changes to be made in app.module.ts ?

For anyone else having this issue.
I used angular 2 moment to solve this
Older iOS versions have issues with the date or number pipe (unsupported APIs)

1 Like

This is great @cyberbobjr ! Big thanks for this solution!
Before it works on iOS 10.2 but crashes on iOS 8.1 without any errors.

installing the intl module "npm install --save intl"
and afterwards the things from @cyberbobjr helps me out of this problem


Not Working in ios i checked.

Not working in iOS device.