Support

Home Forums Event Espresso Premium Hide 2nd day on ee-event-datetimes-li-daterange

Hide 2nd day on ee-event-datetimes-li-daterange

Posted: November 14, 2021 at 10:57 am

Viewing 1 reply thread


joyandraenton

November 14, 2021 at 10:57 am

The events are live music shows which are promoted as a single day event. However the events usually end after midnight, so the event shows dates for 2 days. I don’t want the second day to show as this can be confusing. However, I do want the end time to display. Is there a function that will do this?
screenshot here:
https://ibb.co/cy77h08


Tony

  • Support Staff

November 15, 2021 at 5:28 am

Hi there,

The function used to output those dates is espresso_list_of_event_dates and it’s a pluggable function so you could place a copy of that in your own custom functions plugin to override the default output with whatever you prefer.

We have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

Then change this line (in your custom function) to use something like:

<span class="ee-event-datetimes-li-daterange">' . $datetime->length('days', true) > 1 ? $datetime->date_range($date_format) : $datetime->get_i18n_datetime('DTT_EVT_start', $date_format) . '</span>

So, if the number of days for a DateTime is more than 1, output the DateTime as normal, otherwise output just the start date.

Is that what you are looking for?

Viewing 1 reply thread

The support post ‘Hide 2nd day on ee-event-datetimes-li-daterange’ 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