Upcoming events module: Option from-to

More
7 years 7 months ago #99218 by Stef
Hi,

It would be nice, if the 'upcoming events module' could display more than the start day if the event duration is two days plus.

Example:
The event starts 2017-06-01 and ends 2017-06-04
Actual module display: 2017-06-01: Event Name
Future module display: 2017-06-01 – 2017-06-04: Event Name

Regards,
Stef

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago - 7 years 7 months ago #99277 by James Riley
Replied by James Riley on topic Upcoming events module: Option from-to
Create a template override for /modules/mod_eb_events/tmpl/improved.php or default.php, depending on which layout you're using... (alternately, you can create an override by simply coping the file to /templates/YOUR_TEMPLATE/html/mod_eb_events/ ).

Within the file, look for the line that reads:
Code:
echo JHtml::_('date', $row->event_date, $config->event_date_format, null);

and add the following on the next line:
Code:
echo ' – '.JHtml::_('date', $row->event_end_date, $config->event_date_format, null);

This will work to produce the output you requested, but would additional code would be required before it would be ready for inclusion in the core release (a toggle switch in Config to choose to enable/disable; perhaps special handling for not showing if start and end date are the same; perhaps special handling for same day, but different start and end time *if* times are set and *if* the date format string includes time...)

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 7 years 7 months ago by James Riley.
The following user(s) said Thank You: Stef

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #99880 by Stef
Replied by Stef on topic Upcoming events module: Option from-to
Thank you, James. It worked great like this:
Code:
foreach ($rows as $row) { $k = 1 - $k ; $date = JHtml::_('date', $row->event_date, 'd', null); $month = JHtml::_('date', $row->event_date, 'n', null); $enddate = JHtml::_('date', $row->event_end_date, 'd', null); $endmonth = JHtml::_('date', $row->event_end_date, 'n', null); ... if ($date != $enddate) { ... } else { ... } ... }
Regards,
Stefan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc