How to remove 12:00 am start time for all day event

Home Forums Calendar Products Events Calendar PRO How to remove 12:00 am start time for all day event

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1333029
    Marcy Lyons Gohen
    Participant

    Is it possible to remove the start time (12:00 am) for an all day event?

    #1333138
    Patricia
    Member

    Hey 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

    #1334155
    Marcy Lyons Gohen
    Participant

    I 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?

    #1334914
    Patricia
    Member

    Hi 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

    #1335048
    Marcy Lyons Gohen
    Participant

    This 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>
    #1335834
    Patricia
    Member

    Hi 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

    #1336343
    Marcy Lyons Gohen
    Participant

    Thank you so much for sharing the code! The problem is now fixed.

    #1336351
    Patricia
    Member

    Hi Marcy,

    You are welcome! Let me know if you need anything else and have a great day!

    Regards,

    Patricia

    #1346062
    Support Droid
    Keymaster

    Hey 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

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘How to remove 12:00 am start time for all day event’ is closed to new replies.