Angular 2 Date deserialization

后端 未结 4 644
执念已碎
执念已碎 2020-12-05 07:27

I have an Angular 2 application. A service is requests data from an api that returns the results like the following:

{
    \"data\":[
        {\"id\":1,\"ti         


        
4条回答
  •  渐次进展
    2020-12-05 07:53

    Try out my example if its work for you. And here is the docs for Date and Pipe.

    Date : {{announcement.createdAt | date:'EEE, d MMM,y'}}
    Time : {{announcement.createdAt | date:'shortTime'}}
    

    Output :

    Date : Tue, 20 Dec,2016    
    Time :  2:22 PM
    

提交回复
热议问题