The code current compares next or previous match based on current time against the match date.
shortcodes.php….line 253
if ( $time ) {
if ( $time == ‘next’ )
$search .= ” AND DATEDIFF(NOW(), date
) <= 0″;
elseif ( $time == ‘prev’ )
$search .= ” AND DATEDIFF(NOW(), date
) > 0″;
}
https://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_datediff
DATEDIFF() returns expr1 – expr2 expressed as a value in days from one date to the othe
The important point with this function is it evaluates the result in days not hours (not a faction of a day). So it takes 24 hours after the game has completed before it expires. It is the opposite for “prev”.
An improved approach is the Mysql function.
TIMESTAMPDIFF(HOUR, start_time, end_time)
This will return the difference in hours. You can then compare this to a configurable buffer or threshold (maybe a better term) to include or exclude matches.