Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
I fixed that by putting an if() statement in function month_navbar() in
path_to_includes/display_month.php .
I just changed it so if January is currently displayed then the link for "last
month" will point to the December of the previous year. If December is
currently displayed then the link for "next month" points to January of the
next year.
The altered function:
function month_navbar($month, $year)
{
$html = tag('div', attributes('class="phpc-month-nav"'));
menu_item_append_with_date($html, _('last year'), 'display_month',
$year - 1, $month);
if ($month==1){
menu_item_append_with_date($html, _('last month'), 'display_month',
$year -1, 12);
}else{
menu_item_append_with_date($html, _('last month'), 'display_month',
$year, $month - 1);
}
for($i = 1; $i <= 12; $i++) {
if($i < $month)
$attribs = 'class="phpc-past"';
elseif($i == $month)
$attribs = 'class="phpc-present"';
else
$attribs = 'class="phpc-future"';
menu_item_append_with_date($html, short_month_name($i),
'display_month', $year, $i, false, $attribs);
}
if ($month==12){
menu_item_append_with_date($html, _('next month'), 'display_month',
$year +1, 1);
}else{
menu_item_append_with_date($html, _('next month'), 'display_month',
$year, $month + 1);
}
menu_item_append_with_date($html, _('next year'), 'display_month',
$year + 1, $month);
return $html;
}
-G
Original comment by 5forceg...@gmail.com
on 15 Sep 2010 at 2:27
Thank you for that code. I have added it and have solved the problem.
Original comment by awon...@gmail.com
on 16 Sep 2010 at 3:32
This is fixed in r460. Sorry, I should've released an updated version early as
this is a pretty visible issue.
Original comment by sproctor@gmail.com
on 19 Oct 2010 at 3:58
Original issue reported on code.google.com by
awon...@gmail.com
on 15 Sep 2010 at 11:31