How to get the end hour of an event?

WordPress Event Management, Calendars & Registration Forums General Question How to get the end hour of an event?

This topic contains 2 replies, has 2 voices, and was last updated by  Adrian Maleska 10 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7902

    I’ve got events that are 2 – 6 hours long – so want to display this. Finding the beginning hour is easy but I found no way how to get the end hour of an event.

    My attempt:

    <?php echo eo_get_schedule_start('H:i')." - ".eo_get_schedule_end('H:i')." hr"; ?>  

    Could you help me?

    Adrian Maleska
    #7903

    The functions that you have used relate to occurrences of the event, so eo_get_schedule_start returns the start time and date of the first occurrence, and eo_get_schedule_last would return the start time and date of the last occurrence of the event. (Note that eo_get_schedule_end isn’t a valid function).

    I presume you’re after the start time and end time of a single occurrence of the event, in which case this should do the trick:

    <?php echo eo_get_the_start('H:i')." - ".eo_get_the_end('H:i')." hr"; ?>
    Dario
    #7909

    Oh that easy? Wow, thank you Dario!

    Adrian Maleska
Viewing 3 posts - 1 through 3 (of 3 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.