chbachman chbachman - 1 year ago 70
Javascript Question

Angular Date Filter not filtering in ng-value

// date = 2015-12-05T02:34:45.249Z
<p>{{date | date:'yyyy/MM/dd'}}</p> // This works, shows the correct date

<input type="date" ng-value="{{date | date:'yyyy/MM/dd'}}"> // This doesn't work


I'm not sure what is going on. The first filter works well, but the second one doesn't format the date at all, leaving the date as the initial string.

Answer Source


    <input type="date" ng-value="date | date:'yyyy/MM/dd'">

This will show the correct date format in your structure

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download