tribe_get_events not working as expected

Home Forums Calendar Products Events Calendar PRO tribe_get_events not working as expected

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #55576
    flipp
    Participant

    I’m trying to query a range of events but using tribe_get_events seems to misunderstand the start_date and end_date keys.

    So far I have one event that starts and ends on Sep 11, 2013 and when I execute:

    $events = tribe_get_events(array(‘start_date’ => ’10 Sep 2013′, ‘end_date’ => ’15 Sep 2013′, ‘eventDisplay’ => ‘all’));

    it returns an empty array. When I execute:

    $events = tribe_get_events(array(‘start_date’ => ’10 Sep 2013′, ‘eventDisplay’ => ‘all’));

    it returns the one event however when I execute:

    $events = tribe_get_events(array(‘start_date’ => ’20 Sep 2013′, ‘eventDisplay’ => ‘all’));

    it still returns the one event.

    I’m not sure if something changed in version 3.0; I found this usage in the 2.0 documentation but when I looked up the function in the 3.0 documentation, the document contains very little useful information.

    Is this a bug or has the API changed?

    #55631
    Barry
    Member

    It’s possible your start date, due to its format, is being transformed into the Unix epoch (some time around 1970). Can you instead try using yyyy-mm-dd as the format for your dates?

    #55679
    flipp
    Participant

    Thanks Barry, that did the trick. Maybe consider updating the docs? The 2.0 version only suggests using the ‘j M Y’ format.

    #55818
    Barry
    Member

    We can definitely update them – just for the avoidance of doubt can you link to the specific URL you were looking at?

    #55848
    flipp
    Participant

    Navigate to Products > Documentation > Events Calendar > tribe_get_events or just see the link in the original post.

    #55867
    Barry
    Member

    Thanks, well we’ll look at editing/improving both of those. I’m not actually sure how long the 2.0 documentation will remain online – it’s possible it may be retired at some point in the not to distant future – but I’ll certainly pass your feedback along.

    Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘tribe_get_events not working as expected’ is closed to new replies.