I am trying to add a date to an input but seem to be having real problems with the errors even tho the date is displaying
Formatt code
$scope.formatt=function(dte){
return moment(dte).format("YYYY-MM-DD");
}
Html Code:
<input id="userName" value="{{formatt(contents.PaymentDate)}}" ng-model="contents.PaymentDate" name="username" type="date" class="form-control">
Error:
Error: [ngModel:datefmt] http://errors.angularjs.org/1.5.0/ngModel/datefmt?p0=2017-03-21%2000%3A00%3A00
at angular.js:38
at Array.<anonymous> (angular.js:22838)
at angular.js:26467
at m.$digest (angular.js:16655)
at m.$apply (angular.js:16928)
at g (angular.js:11266)
at t (angular.js:11464)
at XMLHttpRequest.u.onload (angular.js:11405)
It is displaying the date fine but i am still getting the errors, any help would be appreciated
Thank you
ngModelexpectcontents.PaymentDateto be a date as you can see on the error url given on your question https://docs.angularjs.org/error/ngModel/datefmt?p0=2017-03-21%2000:00:00