Can't work date Pipe in Safari


#1

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.


#2

Isn’t that an angular2 still open issue?


#3

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


#4

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


#5

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’;


#6

This should be Fixed with Ionic 2 RC


#7

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


#8

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

I opened an issue:


#10

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’}}


#11

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