Can't work date Pipe in Safari

I using Ionic2 beta.11.

home.ts

private datetime:string = ‘2016-05-01’;

home.html

{{datetime| date:“y-MM-dd”}}

It don’t work in Safari only. thanks.

Isn’t that an angular2 still open issue?

Thanks! I try in Angular2 RC.6. But It don’t work in Safari. It’s Angular2 bug…

Hi @rdlabo,
for a temp Solution put this:
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.en"></script>
in your index.html

Thanks,
Daniel

2 Likes

Yep I did it with polyfill too, but if you want to avoid network problem, you could include it in your app.

  1. Install

    sudo npm install --save intl

  2. Add import to app.ts

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

1 Like

This should be Fixed with Ionic 2 RC

Do you mean adding polyfill will not be necessary anymore right?

Date pipes seems to be fix for Safari…but I face problems using them on iOS

I opened an issue:

I had the same problem too with ionic2 rc1. After applying the solution above, jit environment is fine, but AOT is still failing.

failing example:
{{ entry.value | currency:‘USD’:true:‘1.2-2’ }}
{{ item.expiryDate | date:‘MM/yy’}}

The Problem ist sloved with Ionic 2 RC 3. Please Update.