tribe_get_events upcoming not working with event that ends at future date

Home Forums Calendar Products Events Calendar PRO tribe_get_events upcoming not working with event that ends at future date

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #54015
    figmints
    Participant

    I have an issue with the “tribe_get_events” function. I am passing ‘upcoming’ to the ‘eventDisplay’ property. My problem is that if an event has an end date in the future, this event will be displayed until the end date is complete, even if there is an event for the current date.

    Am I using the function or loop improperly? http://pastebin.com/C2cvYtea for reference.

    #54039
    Barry
    Member

    What you’re describing sounds like expected behaviour – similarly, the calendar’s own upcoming (or “list”) view will also show events where the start date has passed but the end date is in the future.

    #54110
    figmints
    Participant

    If I had an event that was scheduled for today, but an event that scheduled in the past and hasn’t ended, how would I go about this using the API? I want to show the next upcoming event, not an event that began in the past but hasn’t end.

    #54122
    Barry
    Member

    There are a few ways you might solve this. The simplest would be to do what you are doing and simply skip over any events where the start date (you could use the tribe_get_start_date() function) is in the past, based on a simple string comparison.

    If you need something more involved, perhaps because you are building something that requires accurate pagination of results, then you might need to devise a custom query of your own.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘tribe_get_events upcoming not working with event that ends at future date’ is closed to new replies.