0

I have an element <input type="date" ng-model="mydate" custom-date /> which I cannot modify.

The date right now is in format 'yyyy-MM-dd HH:mm:ss Z' I need to format the date to 'yyyy-MM-dd' . How do I write a directive to format all the elements in the application with directive "custom-date "?

Aslo I know angular has date filter https://docs.angularjs.org/api/ng/filter/date , but I dont want to use it

Gokul
  • 1,361
  • 3
  • 19
  • 31

1 Answers1

0

You can't change format for input type="date" fields Refer Is there any way to change input type="date" format?

PS: Even if you wanted, you can't use date filter in ngModel :)

Community
  • 1
  • 1
Deepak N
  • 2,561
  • 2
  • 30
  • 44