DEV Community

Tummala Krishna Kishore
Tummala Krishna Kishore

Posted on

Display datetime correctly in iOS/Safari using ionic2/angular2

The issue is caused by the Intlapi because DatePipe for Angular 2. Release is working fine only for FireFox and Chrome with custom format strings. it Doesn’t work on Safari due to lack of Intl. so as a temporary work around is to include the Intl polyfill

<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.en"></script>

Solution 2 You can use the moment.js which can format your required date as follows

moment(singleTable[0].FromCurrentDate).format("dd/MM/yyyy,h:mm:ss a")

Top comments (0)