hi everyone,
we have requirement to filter the data at view level based on current time. we are using kendo grid.
so trying to use the filters concept.
we have to filter based on enrolldate and term date.
(enrolldate <= currentDate ) && (finaldate ===null or finaldate >= currentdate) ===> Active records
(enrolldate> current date or finaldate < current date) ==> inactive records
try to use the filters but the below scenaio not working:
if the enrolldate is future date and final date is null its throwing as Active records...used below code
if (isactive) { return { logic: "or", filters: [ { logic: "and", filters: [ { field: "enrolldate", operator: "lte", // check current date also value: vue360.dateAndTimeToISOString(new Date()) }, { field: "finaldate", operator: "gte", // check current date also value: vue360.dateAndTimeToISOString(new Date()) }, ] }, { field: "finaldate", operator: "isnull", value: null }, ], }; } else { return { logic: "and", filters: [ { logic: "or", filters: [ { logic: "and", filters: [ { field: "enrolldate", operator: "gt", value: vue360.dateAndTimeToISOString(new Date()) }, { field: "finaldate", operator: "gt", value: vue360.dateAndTimeToISOString(new Date()) }, ] }, { logic: "and", filters: [ { field: "enrolldate", operator: "lt", value: vue360.dateAndTimeToISOString(new Date()) }, { field: "finaldate", operator: "lt", value: vue360.dateAndTimeToISOString(new Date()) }, ] } ] }, { field: "finaldate", operator: "isnotnull", value: null }, ], } }