Create filter last 30 days

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nuno Lopes
    Member
    • Jan 2024
    • 42

    Create filter last 30 days


    Hello,

    I'm trying to create a filter to show only "Recent", that is, orders with Date = Last 30 days, and I'm not able to use the date, nor am I able to consult the documentation, which doesn't refer to any example with a date. Can you help?

    I can do it with "Enum" options, I can do it with "Amount" but I can't do it with dates.

    Nuno Lopes


    Click image for larger version

Name:	image.png
Views:	30
Size:	52.6 KB
ID:	116617
  • item
    Active Community Member
    • Mar 2017
    • 1518

    #2
    Hi,
    don't really understand but your $date is a object, so you need to format : something so if not forget

    'salesOrder.billingDate>=' => $date->format('Y-m-d')

    i prefere so :
    Cond::greaterOrEqual(Cond::column('date'), $date->format('Y-m-d')
    but don't know if work so "salesOrder.billingDate"
    Last edited by item; 04-10-2025, 02:26 PM.
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    • Nuno Lopes
      Member
      • Jan 2024
      • 42

      #3
      Thanks, it worked with the second option.

      Comment

      Working...