Author Topic: Initial filter for date  (Read 254 times)

neoinbiz

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 22
    • View Profile
Initial filter for date
« on: January 13, 2023, 12:16:16 am »
I have been trying to get the initial filter defined for dates that are today and less than or = 30
RAD is the Reported Auth Date new date. Did not find examples for dates with the initial filters defined for the between conditions. Example would be 12/13/2022 - 1/12/2023 
    filters: { RAD: { crules: [{ condition: 'between' }]}},

Code: [Select]
        "RAD": function(ui) {
            if (ui.cellData) {
                let todayMinus30 = new Date(ui.cellData);
                todayMinus30.setDate(todayMinus30.getDate() - 30)
                return todayMinus30;
            };

}


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Initial filter for date
« Reply #1 on: January 13, 2023, 09:31:38 pm »
between condition has 2 fields value and value2

Example of initial filter for between condition:

Code: [Select]
{ title: "Order Date", minWidth: "190", dataIndx: "OrderDate", dataType: "date",
            filter: {                               
                crules: [{
                    condition: "between",
                    value: date1,
    value2: date2
                }]               
            }
},