Reputation: 4888
I tried to format my date:
var startdate = new Date(someDate).toLocaleDateString('en-GB', {
year: 'numeric',
month: 'short',
day: 'numeric'
}).split(' ').join('-');
and I console.log
it appear:
3-Mar-2016
which is exactly what I want. But what appear in html
when I {{someDate}}
or {{someDate.toString()}}
it become:
Thu Mar 03 2016 00:00:00 GMT+0800 (MYT)
How to resolve this?
Upvotes: 0
Views: 29
Reputation: 595
refer to this link AngularJs:API:date you can format it like this
{{someDate| date:'dd-MM-yyyy'}}
Upvotes: 2