urish / angular-moment

Moment.JS directives for Angular.JS (timeago and more)
MIT License
2.6k stars 397 forks source link

Display timestamp #305

Closed sevmardi closed 5 years ago

sevmardi commented 5 years ago

I have the following

created_at : 2016-09-27 10:31:44
updated_at: 2018-07-25 08:34:10

I would like to display this [as simple as possible] in my datatable.

<span> {{item.created_at   | amDateFormat:'YYYY.MM.DD HH:mm a'}} </span>

 <span> {{item.updated_at |  amDateFormat:'YYYY.MM.DD HH:mm a'}} </span>

Any Ideas?

sevmardi commented 5 years ago

Any thoughts on this? If this lib isn't helpful, any other ideas?

sevmardi commented 5 years ago

My fault. The fields created_at and updated_at were hidden from json response.

{{item.created_at | UTC | amDateFormat:'YYYY.MM.DD HH:mm a'}}

Did the trick