Manak Bhardwaj Manak Bhardwaj - 4 months ago 191
AngularJS Question

ngmodel:datefmt expected to be a date in angularjs

I am having this issue in my app

Following is the snippet of my code Code snippet in comments

HTML



How i can make the input a ng-model of type date of vm.user as i am having this exception

Please help

Answer

I have got the solution for my problem

 `<input type="date" name="dates" id="dates" class="form-control" ng-model="dt" placeholder="yyyy-MM-dd" min="2016-01-01" max="2016-12-31" ng-change="m.user.date=dt.toISOString()">`

by changing the model value to ISO String helped me resolve the issue