I wanted the same thing, but didn't succeed to navigate to the next/previous event.
The same problem occurred when listing the events for a single day, which you will get when a day in the calendar is clicked. I wrote some custom code which will create navigation links to the next/previous day. Keep in mind I've only tested this with listing events, not with the event detail page. But maybe this code can also be used for the detail page, who knows
Here is what you do:
Open function.displaylist.php and find the following lines (around line 219):
Code: Select all
$navigation['next'] = $module->CreateLink($id, 'default', $returnid, '', array('year'=>$next_month['year'], 'month'=>$next_month['month']), '', true, true, '', false );
$navigation['prev'] = $module->CreateLink($id, 'default', $returnid, '', array('year'=>$prev_month['year'], 'month'=>$prev_month['month']), '', true, true, '', false );
Replace these lines with:
Code: Select all
if ($day > 0) {
$prev_day['timestamp'] = strtotime("-1 day", mktime(0,0,0,$month, $day, $year));
$prev_day['day'] = date('j', $prev_day['timestamp']);
$prev_day['month'] = date('n', $prev_day['timestamp']);
$prev_day['year'] = date('Y', $prev_day['timestamp']);
$next_day['timestamp'] = strtotime("+1 day", mktime(0,0,0,$month, $day, $year));
$next_day['day'] = date('j', $next_day['timestamp']);
$next_day['month'] = date('n', $next_day['timestamp']);
$next_day['year'] = date('Y', $next_day['timestamp']);
$navigation['next'] = $module->CreateLink($id, 'default', $returnid, '', array('year'=>$next_day['year'], 'month'=>$next_day['month'], 'day'=>$next_day['day']), '', true, true, '', false );
$navigation['prev'] = $module->CreateLink($id, 'default', $returnid, '', array('year'=>$prev_day['year'], 'month'=>$prev_day['month'], 'day'=>$prev_day['day']), '', true, true, '', false );
} else {
$navigation['next'] = $module->CreateLink($id, 'default', $returnid, '', array('year'=>$next_month['year'], 'month'=>$next_month['month']), '', true, true, '', false );
$navigation['prev'] = $module->CreateLink($id, 'default', $returnid, '', array('year'=>$prev_month['year'], 'month'=>$prev_month['month']), '', true, true, '', false );
}
What this code does:
If $day is set (meaning it's listing events for a certain day) it will calculate the date (day, month and year) for the next and previous day. These values are then used to create the navigation links.
Else, if $day is not set (meaning it's listing events for a certain month) it will create links for the next/previous months.
FYI, I'm using Calendar 0.8.2
Hope it helps!
PS. If anyone finds a way to navigate to the next and previous event I would like to hear about it!!