I am using ACF with the Date/Time Picker extension. Currently, I’m using the date picker that’s in the core plugin and the Date/Time picker to only use the time function as to not go through all of our current events, there’s a lot, and update the date fields.
As of now, we’re displaying all upcoming events to the day. What I’m trying to do is display all upcoming events to the day as well as the current hour. So if there’s an event at 7pm and it’s 8pm, that event will not display.
Can anyone recommend a way for me to achieve this?
Here is my current query:
$todays_date = current_time('Ymd');
$args = array(
'post_type' => 'events',
'post_status' => 'publish',
'posts_per_page' => '10',
'meta_query' => array(
'relation' => 'AND',
'date_clause' => array(
'key' => 'event_date_begins',
'compare' => '>=',
'value' => $todays_date,
),
'time_clause' => array(
'key' => 'event_start_time',
'compare' => 'EXISTS',
),
),
'orderby' => array(
'date_clause' => 'ASC',
'time_clause' => 'ASC',
),