I've stumbled across the options in Administer - System Settings - Option Groups and I read somewhere that you can create new ones.. so I tried using the syntax of existing options:

eg Previous 2 calendar years = "previous_2.year"
so I tried Previous 3 calendar years = "previous_3.year"

but that didnt work- just returned empty results (tried lots of others and they all did the same)

any clues please?

  • I think the intention was for users to be able to create new relative date filters, but it didn't happen (yet) AFAIK. Not sure what these option values are doing. Personally I'd love a relative filter that was '6 months ago'
    – Andy Clark
    Dec 15, 2019 at 22:12

1 Answer 1


Certain ones can work by just adding option values, but I don't think everything. For example @andy-clark you can do prior 6 months as "ending_6.month" which is supported by the default clause here https://github.com/civicrm/civicrm-core/blob/5.20.2/CRM/Utils/Date.php#L1660

Take a look through that function to get an idea of what works, in particular the default clauses in each section.

  • thanks for the answer.. but I'm no coder and that is all unintelliglbe to me sadly. But since I now know that some do work I can experiment and see. thanks for the guidance
    – Robinnz
    Dec 17, 2019 at 2:45
  • Ok. In general the "ending" ones will work, but "ending" is different than "previous" in your question. So "ending_3.year" will give you three years back from today, as opposed to (if it worked) "previous_3.year" which would be 2016-2018.
    – Demerit
    Dec 17, 2019 at 3:02
  • Thanks! Last 6 months added
    – Andy Clark
    Dec 17, 2019 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.