Hi
I am setting up a View filter for selecting only (custom) posts where "start_date >= TODAY and end_date =< TODAY". No posts are displayed.
For in WP Settings I have selected the European date format dd/mm/yyyy I am wondering how TODAY is considered in Toolset. I coudn't find any date settings in Toolset. Do you have a clue why the filter doesn't work ?
Thanks
Nicola
Hi, Toolset Types date fields are stored in the database as Unix timestamps, so if start_date and end_date are coming from Types fields then the date format you have chosen for WordPress shouldn't matter. However, the filter terms you provided seem invalid.
start >= TODAY (this means the event starts in the future)
end <= TODAY (this means the event ends in the past)
So you're looking for events that start in the future AND end in the past? That seems contradictory, unless I'm misunderstanding something.
Where are the start date and end date values coming from - are they created by Types custom fields, or by another 3rd party plugin?
Hi Christian,
Actually what I want to achieve is to show a post only if today's date falls between start_end and end_date (both Types custom fields). This means that the post will be visible only after the start_date and will not be displayed after the end_date. The filter window doesn't seem to allow building such a filter, any clue ?
thanks
Okay I understand, thanks for the clarification. In this case, I would use a combination of start date less than or equal to TODAY, and end date less than FUTURE_DAY(1). FUTURE_DAY(1) is essentially midnight tonight/tomorrow morning, so you have a timespan from midnight last night/this morning to midnight tonight/tomrorow morning. Take a look at the screenshot here for an example.
Hi Christian,
I understand the trick and tried it but it doesn't work. I noticed that even the simple start_date <= (or >=) TODAY doesn't work.
All my test posts have a start date of Oct 28th, today is Oct 31st, they shoud be retrieved .... Please check.
Thanks
I see you have selected data type "DATE". You should select "number" instead. The Unix timestamp format in the database is different from DATE, and is stored as a simple number.
My issue is resolved now. Thank you! that's the trick !