angular - How to format a date string with ionic2 -


i'll make concise. have following object:

obj = {date: 2017-04-05t17:48:20.084z} 

how format j.date ? i've tried following code bellow work

<ion-item *ngfor='let j of obj'>     <ion-datetime displayformat="mm/dd/yyyy">{{j.date}}</ion-datetime>  </ion-item> 

according the docs, shouldn’t place j.date inside ion-datetime element, should bind using ngmodel. code:

<ion-item *ngfor='let j of obj'>   <ion-datetime displayformat="mm/dd/yyyy" [(ngmodel)]="j.date"></ion-datetime> </ion-item> 

Comments