Hide "12:00 am" for All Day Events

Home Forums Calendar Products Events Calendar PRO Hide "12:00 am" for All Day Events

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1342388
    Jason
    Participant

    We 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-# -->
    #1342583
    Patricia
    Member

    Hey 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

    #1342691
    Jason
    Participant

    Thanks! 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.)

    #1342973
    Patricia
    Member

    Hi 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

    #1353512
    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 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Hide "12:00 am" for All Day Events’ is closed to new replies.