Problem:
Posts have start and end dates.
Client wants a custom search View to be able to specify start and end dates as a between filter so that if there is any overlap between the range of start-date to end-date of the posts and the filtered date range then posts should match and be displayed.
Solution:
You need to compare the end date of your filter with the start date of your post and the start date of your filter with the end date of the post.
So a partial overlap of the posts and the filters being applied would be achieved if
- the post end date is later than the filter start date (the post hasn't already finished when our filter period starts), and
- the post start date is earlier than the filter end date (the post doesn't begin after our filter period is over)
Insert the start and end filters as normal, then edit them to swap over the URL parameters that provide the filter value.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
This topic contains 2 replies, has 2 voices.
Last updated by 5 years, 5 months ago.
Assisted by: Nigel.