Home › Forums › Calendar Products › Events Calendar PRO › How to remove 12:00 am start time for all day event
- This topic has 9 replies, 2 voices, and was last updated 6 years, 7 months ago by Marcy Lyons Gohen.
-
AuthorPosts
-
August 9, 2017 at 12:19 pm #1333029Marcy Lyons GohenParticipant
Is it possible to remove the start time (12:00 am) for an all day event?
August 9, 2017 at 3:28 pm #1333138PatriciaMemberHey Marcy,
Thank you for reaching out to us!
Can you please send us further information about your request? By default, The Events Calendar automatically removes the start and end time for All Day Events (check out this example).
Let me know if you need anything else and I’ll be happy to assist!
Regards,
Patricia
August 11, 2017 at 9:40 am #1334155Marcy Lyons GohenParticipantI realize what the problem is – the default month view does not show the start time for any event. I modified single-event.php in our theme so that start times are displayed. Therefore all day events show 12:00 am. If I remove this code, other events will not show any time unless you put your mouse over them.
Is there a way to check for an all day event in single-event.php so I will not display the time for those events?
August 14, 2017 at 6:32 am #1334914PatriciaMemberHi Marcy,
Can you please share with us the code you did input in you single-event.php file so we can verify if it is possible to modify it to achieve what you want?
Thanks!
Patricia
August 14, 2017 at 10:39 am #1335048Marcy Lyons GohenParticipantThis is the code:
<div id="tribe-events-event-<?php echo esc_attr( $event_id ); ?>" class="<?php tribe_events_event_classes() ?>" data-tribejson='<?php echo esc_attr( tribe_events_template_data( $post ) ); ?>'> <h3 class="tribe-events-month-event-title"><a href="<?php echo esc_url( $link ) ?>" class="url"><?php echo $title ?></a></h3> <div class="event-time"><?php echo tribe_get_start_date($post->ID, false,'g:ia') ?></div> </div>
August 15, 2017 at 6:07 pm #1335834PatriciaMemberHi Marcy,
Thanks for sharing your code! You will achieve what you want by replacing this line:
<div class="event-time"><?php echo tribe_get_start_date($post->ID, false,'g:ia') ?></div>
with:
<div class="event-time"><?php if(!tribe_event_is_all_day()){ echo tribe_get_start_date($post->ID, false,'g:ia');} ?></div>
I hope this helps!
Let me know if you need anything else and I’ll be happy to assist!
Regards,
Patricia
August 16, 2017 at 1:29 pm #1336343Marcy Lyons GohenParticipantThank you so much for sharing the code! The problem is now fixed.
August 16, 2017 at 1:34 pm #1336351PatriciaMemberHi Marcy,
You are welcome! Let me know if you need anything else and have a great day!
Regards,
Patricia
September 7, 2017 at 9:36 am #1346062Support DroidKeymasterHey 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 ‘How to remove 12:00 am start time for all day event’ is closed to new replies.