Announcement

Collapse
No announcement yet.

Add current week and last week in search/filter date ranges

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Add current week and last week in search/filter date ranges

    Hi,

    Currently, there are many date range filters (current year / month, last month, today, between...).

    But can you help me to add last week and current week filters in date range please?

    In fact, I use currently between filter so, but with the new feature sending automatically grid reports, it is no more relevant

    thank you for your consideration

  • #2
    Hi

    Search in files by contents. Search by 'currentMonth' phrase. And you will find places where you can add new predefined ranges.

    Comment


    • #3
      Hi, thanks but I already tried, with this in Base.php (+ reference added in date.js and datetime js views)

      "case 'currentWeek':
      $dt = new \DateTime();
      $part['AND'] = array(
      $item['field'] . '>=' => $dt->modify('first day of this week')->format('Y-m-d'),
      $item['field'] . '<' => $dt->add(new \DateInterval('P1W'))->format('Y-m-d'),
      );
      break;"

      I also tried "P7D"

      Comment


      • #4
        What result? Some error?

        Comment


        • #5
          No error, just doesn't work, it shows me results of the first week of the last month I think

          Comment


          • #6
            I don't know. Is your code executed when you run search? Did you check?

            Comment


            • #7
              Yes it is. It shows me some results but wrong dateinterval

              Comment

              Working...
              X