-1

I have a text feild with type equal to text.

<input type="text"  ng-model="date"/>
<p>{{date}}</p>
<input type="text" ng-model="date"> // should be able to see date in formatted form here.

When i select a date it p tag showing like.

2002-05-13T00:00:00

i want to show that in proper date format without using another plugin or type="date" because i'm using a plugin with dont have a proper way to format.

How to format the particular date using javascript ?

6

1 Answer 1

2

You can use date filter

Like this

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

4 Comments

beat me to it! I've got to be faster ;)
lol . Lucky this time :) @ShannonHochkins
sorry im not satisfied, i dont want to do it in view side, need to do it in js part
Please go to the link that i mentioned in my answer @Vispriya

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.