In an attempt to create a list sortable by date, I created the following datasource:
sort: { field: 'dateTime', dir: 'asc' },
schema: {
model: {
id: 'Id',
fields: {
dateTime: {
field: 'DateTime',
type: 'Date',
parse: function (value) {
return kendo.toString(kendo.parseDate(value), 'MM/dd/yyyy hh:mm tt');
}
},
stuff: 'Stuff'
}
}
}
After filling it with data, I noticed that the rows in the bound list were sorting alphabetically like:
- 01/02/2015 08:22 PM
- 12/12/2014 09:00 PM
- 12/18/2014 08:22 PM
How can I get these dates to sort in ascending chronological order?