year calendar: Avoid highlighting the current month in a different year

master
Joey Hess 2009-10-12 14:22:48 -04:00
parent 5c78192435
commit 28c4caea59
1 changed files with 3 additions and 2 deletions

View File

@ -262,8 +262,9 @@ sub format_year (@) {
my $pyear = $params{year} - 1;
my $nyear = $params{year} + 1;
my $thisyear = $now[5]+1900;
my $future_month = 0;
$future_month = $now[4]+1 if ($params{year} == $now[5]+1900);
$future_month = $now[4]+1 if $params{year} == $thisyear;
my $archivebase = 'archives';
$archivebase = $config{archivebase} if defined $config{archivebase};
@ -314,7 +315,7 @@ EOF
$calendar.=qq{\t<tr>\n} if ($month % $params{months_per_row} == 1);
my $tag;
my $mtag=sprintf("%02d", $month);
if ($month == $params{month}) {
if ($month == $params{month} && $thisyear == $params{year}) {
$tag = 'year-calendar-this-month';
}
elsif ($pagesources{"$archivebase/$params{year}/$mtag"}) {