I'm having trouble getting date filtering to work. Apologies if this has been answered in another post; searched but didn't find anything that worked for me.
Here's what I have:
My data is JSON and looks like this:
[
{
"Version":
“Initial”,
"VersionDate": "2016-04-15T13:15:37Z",
},
{
"Version":
“Revision”,
"VersionDate": "2016-04-18T14:15:37Z",
}
]
Here's my relevant grid setup:
$("#grid").kendoGrid({
dataSource: {
transport:
{
read:
{
url: dataUrl //returns the JSON as seen above,
}
},
schema: {
model: {
fields: {
Version:
{ type: "string" },
VersionDate: { type: "date" }
}
}
}
columns: [
field: "Version",
title:
"Version"
}, {
field: "VersionDate",
title:
"Date",
format: "{0:MM/dd/yyyy}",
filterable:
{
ui:
function(e) {
element.kendoDatepicker({
format: “MM/dd/yyyy”
})
}
}
}
],
filterable: true
}
});
My issue:
The dates display in the desired format in the grid, e.g. 04/15/2016; and the filter ui allows me to choose dates with a datepicker in the same format. However, when I filter I get no results. I'm assuming this is because the filtering works on the original data which is a string and is not finding a match because of the different format. What do I need to do in order to get date filtering to work properly? Do I need to do a parse function in my schema set up or some combination of things?
Another note - if I set this up using grid row filtering, I get the following error in console and never see the no results message:
TypeError: n.toLowerCase is not a function
I assume again this has to do with the original data being a date in string format, just can't seem to find the correct set up option(s) to make filtering work.
Please let me know if I need to provide further information; screenshots, example file, etc.