Home › Forums › Calendar Products › Events Calendar PRO › Display event start and end dates on a recurrent event
- This topic has 4 replies, 3 voices, and was last updated 9 years, 11 months ago by
Support Droid.
-
AuthorPosts
-
May 8, 2016 at 9:50 am #1112017
BOUCHAIR
ParticipantHello
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 2016but 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
May 8, 2016 at 3:50 pm #1112055George
ParticipantHey @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,
GeorgeMay 8, 2016 at 11:53 pm #1112109BOUCHAIR
ParticipantHello,
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 youMay 9, 2016 at 2:07 pm #1112384George
ParticipantHey @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,
GeorgeMay 24, 2016 at 9:35 am #1118267Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Display event start and end dates on a recurrent event’ is closed to new replies.
