Hi,
I have a view that filters and exports data from a CPT in which there is a date (the CPT are availability dates).
To date, there is a filter on the date (date equal to the date entered in the filter).
Now I would also like the view to propose the results to me no earlier than the next 3 months.
I have tried entering a new filter in the view but I can no longer select the date field. How can I proceed?
The filter you have for a date field is a front-end filter where the user enters the date and then the View returns posts which match that date.
For example, if they entered the date 1 August 2024 it would show posts with that same date.
But now you would also like to return posts not just from 1 August 2024 but also up to 3 months after 1 August 2024, is that correct? (So, from 1 August 2024 to 1 November 2024.)
It is not possible to add multiple conditions for a single filter in the UI (the exception is when you choose a BETWEEN comparison, where the user can specify a start and end date).
In the UI you can update the comparison for the existing date field filter to use ">=" (greater than or equal to) the entered date. That will return posts, in my example above, from 1 August 2024 and later.
If you combined that with pagination it could show, for example, posts marked 1 August 2024 and up to 10 more posts later than 1 August 2024. (That could perhaps make more sense for your UI.)
If you did want to explicitly show up to 3 months of results after the filtered date then you would need to use the API to modify the query that returns the posts (specifically modifying the meta query condition).