angular-input-date
angular-input-date copied to clipboard
Error: [ngModel:datefmt] Expected `2017-02-03` to be a date
hey,
when I use your code I got this error:
Error: [ngModel:datefmt] Expected
2017-02-03 to be a date http://errors.angularjs.org/1.5.3/ngModel/datefmt?p0=2017-02-03 at ionic.bundle.js:13438 at Array.<anonymous> (ionic.bundle.js:36469) at ngModelWatch (ionic.bundle.js:40103) at Scope.$digest (ionic.bundle.js:30230) at Scope.$apply (ionic.bundle.js:30503) at done (ionic.bundle.js:24824) at completeRequest (ionic.bundle.js:25022) at XMLHttpRequest.requestLoaded (ionic.bundle.js:24963)
html:
<input type="date" placeholder="Birthday" class="textbox-n" ng-model="data.birthday">
the Birthday type is Date not string and I got this error, I don't know why !!
cya
Hello! Thank you for your interest in this module!
May I ask, why do you need this module? Current version on Angular supports input[date]
out of the box.
I want use this module to change the format of my date. coz when I write in my html
ng-model="data.birthday"
I got the date type Long for example, 148457958, that's why ;)
Could you please create a Plunk to demonstrate the issue?
this is the solution data.birthday = new Date(data.birthday);
But decrements 1 day to the date! How can i avoid it?
new Date(data.birthday + '23:59:59');