Home › Forums › Calendar Products › Events Calendar PRO › Hide "12:00 am" for All Day Events
- This topic has 5 replies, 2 voices, and was last updated 8 years, 6 months ago by
Jason.
-
AuthorPosts
-
August 30, 2017 at 8:49 am #1342388
Jason
ParticipantWe added some time ago start times to our month view in our calendar. One complaint we always get from parents is the 12:00 a.m. start time for an all day event.
Is there a filter that I can add that will hide the time if the All Day Event is flagged?
<div id="tribe-events-event-<?php echo $event_id ?>" class="<?php tribe_events_event_classes() ?>" data-tribejson='<?php echo tribe_events_template_data( $post, $additional_data); ?>'> <h3 class="tribe-events-month-event-title entry-title summary"> <span class="tribe-events-override"><?php echo tribe_get_start_date( $post->ID, false, get_option( 'time_format' )) . ' '; ?></span> <br /> <a href="<?php tribe_event_link( $post ); ?>" class="url"><?php echo the_title() ?></a> <br /> <span class="tribe-events-override"><?php tribe_custom_field('Room Code'); ?></span></h3> </div><!-- #tribe-events-event-# -->August 30, 2017 at 11:08 am #1342583Patricia
MemberHey Jason,
Thank you for reaching out to us!
To achieve what you want, please replace the code you just shared (at [your-theme]/tribe-events/month/single-event.php) with the following:
https://gist.github.com/nefeline/d74ff6806108771b4da7b951eff57753
I’m suggesting this change because your code is using a deprecated function (tribe_event_link) and is throwing some PHP Notices.
If you prefer to stick with your customization, please replace ‘tribe_event_link’ with ‘tribe_get_event_link’ and use the following code to wrap your time function:
<?php if(!tribe_event_is_all_day()){ [your function tribe_get_start_date] } ?>I hope this helps!
Let me know if you need anything else and I’ll be happy to assist!
Best Regards,
Patricia
August 30, 2017 at 1:33 pm #1342691Jason
ParticipantThanks! That fixed it and will make lots of folks happy!
(Also gave me the kick in the pants to check and update all the custom views inside my theme.)
August 31, 2017 at 4:43 am #1342973Patricia
MemberHi Jason,
Awesome! Good to know everything is working as expected now 🙂
Let me know if you need anything else and have a great day!
Cheers,
Patricia
September 22, 2017 at 9:35 am #1353512Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Hide "12:00 am" for All Day Events’ is closed to new replies.
