I am using the javascript kendo grid and applying a custom filter for the year of 2015. This is my code
//Filter by Year
$(
'#year'
).on(
'change'
,
function
() {
var
grid = $(
"#grid"
).data(
"kendoGrid"
);
var
val =
this
.value;
var
fd =
new
Date(val, 0, 1);
var
firstday = fd;
var
ld =
new
Date(val, 11, 31);
var
lastday = ld;
grid.dataSource.filter({
logic:
"and"
,
filters: [
{ field:
"CheckDate"
, operator:
"gte"
, value: firstday },
{ field:
"CheckDate"
, operator:
"lte"
, value: lastday }
]
});
});
The last date of the year is set as filter 12/31/2015. However, when the filter is applied it doesn't return any of the items with the 12/31/2015. It returns everything else but anything with the last date of the year.