Sarthak Sanghavi Sarthak Sanghavi - 1 month ago 44
AngularJS Question

Expected `1970-01-01T11:30:00.000Z` to be a date

angular.js:13920 Error: [ngModel:datefmt]

http://errors.angularjs.org/1.5.8/ngModel/datefmt?p0=1970-01-01T11%3A30%3A00.000Z

at angular.js:38
at Array.<anonymous> (angular.js:24164)
at angular.js:27810
at m.$digest (angular.js:17515)
at b.$apply (angular.js:17790)
at HTMLAnchorElement.<anonymous> (angular.js:25890)
at HTMLAnchorElement.dispatch (jquery-1.10.2.js:5109)
at HTMLAnchorElement.elemData.handle (jquery-1.10.2.js:4780)

Answer

Your model need to be a Date object, so Use this

$scope.your_date_model = new Date(your_date_variable);

Thanks