Remove Start Time and End Time from all events

Home Forums Calendar Products Events Calendar PRO Remove Start Time and End Time from all events

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #90499
    oneyellowtree
    Participant

    I only want to show dates on all instances of an event (front-end submission, list view, advanced list widget, month view, single event view). I do not want to show start time or end time at all.

    I’ve bounced through the forums for the past couple of days trying to figure it out. End time seems to be pretty simple – based on another post I added this to my child theme functions.php:

    add_filter(‘tribe_events_event_schedule_details’, ‘remove_end_times’);

    function remove_end_times($datetime) {
    $pos = strrpos($datetime, ‘- <span class=”end-time’);
    return substr($datetime, 0, $pos);
    }

    But start time is a whole other story. It seems to be attached directly to the start date (which I want to show)…

    I’ve been looking around for hours… please help save my sanity as it seems like such a basic thing to do!

    #91604
    Brook
    Participant

    Howdy oneyellowtree,

    The date and time are definitely attached, really they are unix timestamps so the “date” is actually stored as the amount of seconds that have transpired since 1970. However, what you want should still be possible by simply checking the “All day event” box for every event, this hides the start time, and even the end date if the end date is the same.

    The following snippet will enforce all day events site-wide though, if you would like to do this on a less selective basis. http://pastebin.com/5TEs27LP

    Will that work for you? Please let me know. Thanks!

    – Brook

    #93612
    oneyellowtree
    Participant

    Thank you Brook – that did the trick. For anyone else looking to achieve this: In the end, I did not use the function I posted above. For my specific setup, this is what worked:

    1. Forced all day using Brook’s functions.php snippet: http://pastebin.com/5TEs27LP
    2. Disabled recurring events using another functions.php snippet: https://theeventscalendar.com/support/forums/topic/turn-off-recurring-for-community-events/
    3. Hid the time selectors in /modules/datepicker.php
    <div style=”display:none;”>
    <span class=”timeofdayoptions”>
    <?php echo tribe_community_events_form_end_time_selector(); ?>
    </span>
    </div>
    4. The option for users to select all-day events can also be removed (using display:none;)

    #93758
    Leah
    Member

    Awesome oneyellowtree, thanks for posting that!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Remove Start Time and End Time from all events’ is closed to new replies.