Display event start and end dates on a recurrent event

Home Forums Calendar Products Events Calendar PRO Display event start and end dates on a recurrent event

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1112017
    BOUCHAIR
    Participant

    Hello

    After installing the Pro version and adding some recurrent events, the code below return wrong dates :

    I have an Event on 2 non consecutives dates :
    June 27 and July 04
    With my code below it is displayed as :
    27 Juin 2016
    04 Juil 2016

    but for a non recurrent event :
    It is well displayed
    23 Juin 2016 – 24 Juin 2016

    
    <ul class="formation1">
    								<?php if($get_posts->have_posts()) : while($get_posts->have_posts()) : $get_posts->the_post(); ?>
      
    								<?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
    								<li><?php echo tribe_get_start_date( null, false, 'd M Y' ); ?> - <?php echo tribe_get_end_date( null, false, 'd M Y' ); ?> / <?php echo tribe_get_cost( ) . '€'; ?></li>
    								<?php } else { ?>
    								<li><?php echo tribe_get_start_date( null, false, 'd M Y' ); ?> / <?php echo tribe_get_cost( ) . '€'; ?></li>
    								<?php } ?>
      
      
    
    								<?php
    								endwhile;
    								endif; ?>
    								</ul>

    Thank you for your help

    #1112055
    George
    Participant

    Hey @BOUCHAIR,

    Can you clarify where this code comes from?

    It does not look like anything from our own plugins—is it custom code?

    We unfortunately cannot help with troubleshooting custom code. Please read more about this here ? https://theeventscalendar.com/knowledgebase/what-support-is-provided-for-license-holders/

    Sincerely,
    George

    #1112109
    BOUCHAIR
    Participant

    Hello,
    In this case, can you tell me, what functions are used to :
    1) Check if an event is a recurrent event or not
    2) Get all serie dates of a recurrent event
    3) Get start and end dates of a recurrent event
    Thank you

    #1112384
    George
    Participant

    Hey @Bouchair,

    1. tribe_is_recurring_event()
    2. This is not easily possible, but is best done with tribe_get_events(). You can learn more about how to use that function here ? https://theeventscalendar.com/knowledgebase/using-tribe_get_events/
    3. tribe_get_start_date() and tribe_get_end_date()

    Need to learn more about these functions? The best way to do so is to open up your code editor and look for where the functions are defined. You can use your code editor’s “search” and “find in folder” features to do this.

    While I cannot answer further questions about custom coding, how to use functions, etc., if there is anything else I can try to help with here let me know. If not I will close up the thread! 😀

    Thanks,
    George

    #1118267
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Display event start and end dates on a recurrent event’ is closed to new replies.