eo_get_current_occurrence_of

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 11 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2765

    Would you be able to add a “eo_get_current_occurrence_of” function?

    This would be the equivalent of “eo_get_next_occurrence_of” but returns an object for the occurrence currently taking place whereas “eo_get_next_occurrence_of” returns the next one even when one is currently happening.

    Alternatively, could an optional parameter be added to “eo_get_next_occurrence_of” to allow it to return the current occurrence when there is one or have it respect the “Are current events past?” flag from settings.

    Thanks,
    Paul

    Paul
    #2768

    So there may be dates where this is no occurrence currently occurring – would this return false in those situations?

    Also, occurrences can technically overlap (a 2-day event occurring every day, for example). Though its unlikely to occur in practise, it’ll need to decide whether to return the earlier or the later occurrence…

    In the meantime if you require the functionality you can use eo_get_the_occurrences_of() and perform a loop to pull out the correct date.

    Stephen Harris
    #2771

    I would return false when there are none – this would be consistent with the other functions.

    With overlaps, personally, I’d return the later one as (I would guess that) the person viewing the page is more likely to want to attend the occurrence with the most time left to run.

    Alternatively, return an array of all current occurrences and call the function “eo_get_current_occurrences_of” so developers expect to work through an array.

    Thanks for the quick response.

    Paul
    #2937

    Hi Paul – opened up a ticket for this. Should be in 1.7 (~Feb)

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.