diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-10-12 14:22:48 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-10-12 14:24:28 -0400 |
commit | 28c4caea59543b6d8fd0c62ff5a60aff67a9bba7 (patch) | |
tree | c1582e33b5aa4f890af9459fbb1d5e09972ef68b | |
parent | 5c78192435210cdb7792ed56b04c2ef24a2d2127 (diff) | |
download | ikiwiki-28c4caea59543b6d8fd0c62ff5a60aff67a9bba7.tar ikiwiki-28c4caea59543b6d8fd0c62ff5a60aff67a9bba7.tar.gz |
year calendar: Avoid highlighting the current month in a different year
-rw-r--r-- | IkiWiki/Plugin/calendar.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index ddcd1a823..c9bdf4a17 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -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"}) { |