Closed blowsie closed 8 years ago
The issue here is that the string is not a type of date, To fix this I implemented a helper inside the link function to create a date from the model provided.
link: function(scope){
var model = scope.model[scope.options.key]
var isDate = (model instanceof Date)
if(!isDate){
scope.model[scope.options.key] = new Date(model);
}
},
I updated the the ui-datepicker example to have an initial value in the model
http://jsbin.com/gujowivini/1/edit?js,output
This made the field and form have a $error with date.
Changing the date to another day, and then changing it back again results in the field being valid even though the value is exactly the same.
Any ideas what is going on here?
Thanks