Upcoming Calendar Events Can Be 1 Day Out
Submitted Guest, Dec 12 2011 10:34 PM | Last updated Dec 12 2011 10:34 PM
/admin/applications_addon/ips/calendar/sources/hooks.php
I assume this code is so events on the same day still show even if the event start time has passed? The trouble is, by adding a whole day, the event can be pushed into the following day causing the date to show incorrectly. It looks like we need to add enough time so it still shows but not enough to push it over into the next day. If my assumption is correct the following should fix but feels hacky.
Ticket #774922 if an example is needed
if ( !$u['event_recurring'] AND ( ( $u['_end_time'] >= $our_unix AND $u['_start_time'] <= $max_date )
OR ( !$u['_end_time'] AND $u['_start_time'] >= $our_unix AND $u['_start_time'] <= $max_date ) ) )
{
if( $u['_end_time'] )
{
while( $u['_start_time'] < time() )
{
$u['_start_time'] += 86400;
}
}
$events[ str_pad( $u['_start_time'].$u['event_id'], 15, "0" ) ] = $u;
}
I assume this code is so events on the same day still show even if the event start time has passed? The trouble is, by adding a whole day, the event can be pushed into the following day causing the date to show incorrectly. It looks like we need to add enough time so it still shows but not enough to push it over into the next day. If my assumption is correct the following should fix but feels hacky.
$u['_start_time'] += gmmktime( 0, 0, 0, $month, $day+1, $year) - time();
Ticket #774922 if an example is needed
| Status: | Fixed |
| Version: | 3.2.1 |
| Fixed In: | 3.3.0 |











2 Comments
if( $u['_end_time'] ) { if( $u['_start_time'] < gmmktime( 0 ) ) { $u['_start_time'] = gmmktime( 0 ); } }Testing locally it seems ok so far.