Countdown module doesn't show the next event

More
2 years 3 weeks ago #688 by Jaap
Jaap created the topic: Countdown module doesn't show the next event
I had the problem that the countdown module didn't showed the next comming event.
It was only the case for events with an empty start time (only the date was filled).
Those events seem to be stored in the database with start time 50:00:00. (A bit strange, I would have expected NULL but I guess there will be good reasons for that...)

I changed one statement (to add support for 50:00:00) in the file modules/mod_simplecalendar_countdown/helper.php (starting at line 157)

Old
if ( $params->get('count_to_next', 0) == 1 ) {
$query->where('CASE WHEN a.start_time IS NOT NULL THEN CAST(CONCAT( a.start_dt, \'-\', a.start_time) AS datetime) '.
'ELSE a.start_dt END >= CAST(now() AS datetime)');
$query->order('a.start_dt ASC, a.start_time ASC LIMIT 1');
} else {

New
if ( $params->get('count_to_next', 0) == 1 ) {
$query->where('CASE WHEN a.start_time = \'50:00:00\' THEN CAST(CONCAT( a.start_dt, \'-00:00:00\') AS datetime) ' .
' WHEN a.start_time IS NULL THEN CAST(CONCAT( a.start_dt, \'-00:00:00\') AS datetime) ' .
' ELSE CAST(CONCAT( a.start_dt, \'-\', a.start_time) AS datetime) END >= CAST(now() AS datetime)');
$query->order('a.start_dt ASC, a.start_time ASC LIMIT 1');
} else {
The topic has been locked.
More
1 year 10 months ago #703 by admin
admin replied the topic: Countdown module doesn't show the next event
Corrected in the upcoming release
Thanks and best regards
Fabrizio
The topic has been locked.
Time to create page: 0.230 seconds
Powered by Kunena Forum