Home › Forums › Calendar Products › Events Calendar PRO › Remove Start Time and End Time from all events
- This topic has 3 replies, 3 voices, and was last updated 10 years, 2 months ago by Leah.
-
AuthorPosts
-
January 11, 2014 at 11:08 am #90499oneyellowtreeParticipant
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!
January 13, 2014 at 3:32 pm #91604BrookParticipantHowdy 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
January 16, 2014 at 10:51 am #93612oneyellowtreeParticipantThank 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;)January 16, 2014 at 4:19 pm #93758LeahMemberAwesome oneyellowtree, thanks for posting that!
-
AuthorPosts
- The topic ‘Remove Start Time and End Time from all events’ is closed to new replies.