@debussy and others suggest a method of filtering Resources relative to current date. See:
http://forums.modx.com/thread/43727/getresources-to-show-current-and-future-events#dis-post-419669
I've done this, and it works fine:
&tvFilters=`eventDate>>[[!currentDatetime]]`
However, I want to further restrict Resources. I want the set of those Resources bearing a date TV three months or less in the future. This does the job, ugly though it may be:
&tvFilters=`eventDate>>[[!currentDatetime]],eventDate<<[[!currentDatetime:strtotime:add=`7889400`:date=`%Y-%m-%d %H:%i:%s`]]`
That's right, the average number of seconds in three months is 7889400. Since months vary in length from 28 to 31 days, there is some "jitter" in this quick & dirty approach, but it works well enough for my particular use case.
By the way, only after careful experiment did I learn about continuing a multi-condition tvFilters string onto a new line. It must be done like this:
&tvFilters=`eventDate>>[[!currentDatetime]]
,eventDate<<[[!currentDatetime:strtotime:add=`7889400`:date=`%Y-%m-%d %H:%i:%s`]]`
It won't work like this
&tvFilters=`eventDate>>[[!currentDatetime]],
eventDate<<[[!currentDatetime:strtotime:add=`7889400`:date=`%Y-%m-%d %H:%i:%s`]]`
Placement of the comma
after the newline is critical.
[ed. note: halfnium last edited this post 10 years, 8 months ago.]