Jen143Me February 2016

DateFormat in angularjs

I wanted to achieve this format: "Saturday, August 30, 2014"

I have this code in my view:

{{masterlist.created_date}}

And the result looks like this:

/DATE(1452842730000)/

What should I do in my controller or in the view? Thanks.

Answers


rkalita February 2016

First of all you date should be in correct format

Use datefilter from angular {{masterlist.created_date | date:'fullDate'}}

Here is the doc


ashfaq.p February 2016

Angular provides many filters, among them one is for date. It provides various format to format your date. Read about them here: date filter: angularjs

But filters can prove performance bottleneck, so its better to avoid them nd format your date on server side.

Post Status

Asked in February 2016
Viewed 2,332 times
Voted 6
Answered 2 times

Search




Leave an answer