0

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?

1 Answer 1

2

refer to this link AngularJs:API:date you can format it like this

{{someDate| date:'dd-MM-yyyy'}} 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.