angular-input-date icon indicating copy to clipboard operation
angular-input-date copied to clipboard

Error: [ngModel:datefmt] Expected `2017-02-03` to be a date

Open Kamaw opened this issue 7 years ago • 6 comments

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

Kamaw avatar Mar 10 '17 15:03 Kamaw

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.

slavafomin avatar Apr 10 '17 16:04 slavafomin

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 ;)

Kamaw avatar Apr 10 '17 20:04 Kamaw

Could you please create a Plunk to demonstrate the issue?

slavafomin avatar Apr 11 '17 05:04 slavafomin

this is the solution data.birthday = new Date(data.birthday);

yhoshua6 avatar Jul 18 '17 20:07 yhoshua6

But decrements 1 day to the date! How can i avoid it?

elyohan14 avatar Aug 09 '18 21:08 elyohan14

new Date(data.birthday + '23:59:59');

fabritha avatar Nov 20 '19 13:11 fabritha