- Posts: 7
- Thank you received: 0
Upcoming events module: Option from-to
- Stef
- Topic Author
- Offline
- New Member
Less
More
7 years 7 months ago #99218
by Stef
Upcoming events module: Option from-to was created 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
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.
- James Riley
- Offline
- Platinum Member
7 years 7 months ago - 7 years 7 months ago #99277
by James Riley
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 :.
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:
and add the following on the next line:
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...)
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.
- Stef
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
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:
Regards,
Stefan
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 {
...
}
...
}
Stefan
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.