ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: neoinbiz on February 20, 2021, 01:47:41 am
-
Is there a away to pre-define a filter by todays date and other date values older than 7 days from today?
-
Please check this example on pre defined filters:
https://paramquery.com/pro/demos/filter_initial
And to get a date older than 7 days, use "less" filter condition with
new Date(Date.now() - 7 * 24 * 60 * 60 * 1000)
-
This does give the date of 7 days older but did not pre-define the filter for the Created column.
I changed the date to be the 7 day of date of 2/15/2021
Am I missing something?
{ title: "Created", width: "8%", dataIndx: "Created",
render: function (ui) {
if (ui.rowData.Created) {
var usaDate = new Date(Date.now() -7 * 24 * 60 * 60 * 1000);
return usaDate.getMonth() + 1 + "/" + usaDate.getDate() + "/" + usaDate.getFullYear();
}
}
},
-
Please add this filter property to the column:
filter: {
crules: [{
condition: 'less',
value: $.datepicker.formatDate("mm/dd/yy", new Date(Date.now() - 7 * 24 * 60 * 60 * 1000))
}]
}