Support

Home Forums Events Calendar Add-on How to hide event times on calendar

How to hide event times on calendar

Posted: January 23, 2018 at 2:31 pm


FAMWeb

January 23, 2018 at 2:31 pm

We have some events that are all-day events. I was surprised that EE does not support all-day events by default, but we were able to make it work by hooking into the “espresso_list_of_event_dates” function and removing the start/end times if they are the same time. For example, if you set the start time as 1:00am and the end time as 1:00am, then it won’t output the times for that event. That works fine for us.

However, this doesn’t affect the Calendar add-on. Is there a way to do something similar for the calendar times? I checked out calendar module php file, but did not see a pluggable function. This seems to be the relevant part of the code in that file:

`$startTime = ‘<span class=”event-start-time”>’ . $datetime->start_time($this->config()->time->format) . ‘</span>’;
$endTime = ‘<span class=”event-end-time”>’ . $datetime->end_time($this->config()->time->format) . ‘</span>’;

if ( $this->config()->time->show && $startTime && ! $pswrd_required ) {
$event_time_html = ‘<span class=”time-display-block”>’ . $startTime;
$event_time_html .= $endTime ? ‘ – ‘ . $endTime : ”;
$event_time_html .= ‘</span>’;
} else {
$event_time_html = FALSE;
}
$calendar_datetime->set_event_time($event_time_html);`

And this for the popup:

`// show time ?
$tooltip_html .= $this->config()->time->show && $startTime && ! $pswrd_required ? ‘<p class=”time_cal_qtip”>’ . __(‘Event Time: ‘, ‘event_espresso’) . $startTime . ‘ – ‘ . $endTime . ‘</p>’ : ”;`

Is this possible?


FAMWeb

January 23, 2018 at 2:32 pm

(sorry, not sure why my code didn’t format properly above)


Tony

  • Support Staff

January 24, 2018 at 4:20 am

Hi there,

Which version number of the Calendar add-on are you using?

It looks like you are using an older version of the calendar as v3.2.9+ has a filter in the above code you could have used to alter the time.

If you update to the latest version you’ll find the FHEE__EE_Calendar__get_calendar_events__event_time_html which can be used to do exactly what you need to do outside of the tooltip.

You’ll also find the FHEE__EE_Calendar__get_calendar_events__calendar_datetime filter at the end of the function which allows you to do all of what you need but you’ll need to rebuild the tooltip HTML to remove it from that section.


FAMWeb

January 24, 2018 at 7:53 am

Ah, ok! I forgot that the add-on updates don’t show up in our WordPress plugin list. I will download the most recent version and give it a shot. Thanks!

The support post ‘How to hide event times on calendar’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso