Author Topic: Pre-Defined filter 7 days old from today  (Read 1219 times)

neoinbiz

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 20
    • View Profile
Pre-Defined filter 7 days old from today
« 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?
« Last Edit: February 20, 2021, 01:50:39 am by neoinbiz »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5785
    • View Profile
Re: Pre-Defined filter 7 days old from today
« Reply #1 on: February 22, 2021, 02:53:44 pm »
[ Only Pro members may read this post. ]

neoinbiz

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Pre-Defined filter 7 days old from today
« Reply #2 on: February 22, 2021, 07:16:06 pm »
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?

Code: [Select]

{ 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();
    }
}
},

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5785
    • View Profile
Re: Pre-Defined filter 7 days old from today
« Reply #3 on: February 22, 2021, 10:07:11 pm »
[ Only Pro members may read this post. ]