I've defined Models for all my data entities especially to assign date data types. When I use them inside a DataSource everything works fine. However if I try the model as stand-alone to create a model from JSON parsed data, the dates are not parsed.
Am I doing this wrong?
Here's a dojo:
http://dojo.telerik.com/olOce/2
Code:
var MyModel = kendo.data.Model.define({
id: "id", // the identifier of the model
fields: {
myDate: { type: "date" }
}
});
var inst = new MyModel({
id: 10,
myDate: "2017-03-30T00:45:11.804"
});
// should be "Date"
alert(typeof inst.myDate);