1

Is there a way to use years as a date filter offset? What I want is to set it so that it it loads all content from the start of the previous year. So >= 01-01-2017 this year, >= 01-01-2018 next year, etc. Is there a way to do that in the View configuration so that it's dynamic? I'm sure I could do it with custom code by altering the query, but I'd rather avoid that.

4
  • Have you tried a <= filter?
    – mpdonadio
    Commented Dec 17, 2018 at 21:05
  • I would need it to be dynamic. So if I put a specific date I would have to update the configuration every year, which I don't want. What I want is to set it so that it it loads all content from the start of the previous year. So >= 01-01-2017 this year, >=01-01-2018 next year, etc. Commented Dec 17, 2018 at 21:11
  • now -1 year default value?
    – Kevin
    Commented Dec 17, 2018 at 21:38
  • @Kevin Nope that only covers 12/2017 to 12/2018 Commented Dec 17, 2018 at 21:59

1 Answer 1

2

It turns out this was more of a PHP strtotime() question. I just had to figure out the appropriate phrase to get the time frame I wanted, which is: "first day of january last year". I placed that phrase in the filter's offset value.

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.