tribe_get_events() and Display of Non-future Events
-
I am writing a custom presentation piece for The Events Calendar (3.5.1) which is supposed to gather posts for the current week and display them.
I seem to be encountering a bias against past/current day events in tribe_get_events().
I suspect I’m not passing an appropriate argument (because my past/current events show fine in full calendar (Month) view).
I know it’s based on past date, because if I move the event forward, it eventually drops into my week view.
The key code looks like so:
$args = array( 'meta_key' => '_EventStartDate', 'meta_value' => array( $start_date, $end_date ), 'meta_compare' => 'BETWEEN', ); $week_events = tribe_get_events($args);
$start_date and $end_date are set to include date and time. Values are verified as they are printed when the query is run.
Samples dates/times are:
$start_date = 2014-04-28 00:00:00 $end_date = 2014-05-02 23:59:59
The event not showing is slated for 2014-04-28 14:00:00 to 2014-04-28 17:00:00. It won’t show on 4-29, but will show on 4-30 (i.e. tomorrow… a future event).
I’ve checked the docs at https://docs.tri.be/Events-Calendar/function-tribe_get_events.html and trampled through the plugin source a bit, unfortunately without luck…
Any help would be greatly appreciated!
EDIT: URL fix
- The topic ‘tribe_get_events() and Display of Non-future Events’ is closed to new replies.