X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/a27f4a47ba0435233ed272e2541feab4e0868b32..e0b3590bd958675b833c5fc3e001c31e04417580:/IkiWiki/Plugin/calendar.pm diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 30e2f26a3..a4a54d2c8 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -22,6 +22,7 @@ use warnings; use strict; use IkiWiki 2.00; use Time::Local; +use POSIX; my %cache; my %linkcache; @@ -31,7 +32,7 @@ sub import { #{{{ hook(type => "preprocess", id => "calendar", call => \&preprocess); } #}}} -sub is_leap_year (@) { #{{ +sub is_leap_year (@) { #{{{ my %params=@_; return ($params{year} % 4 == 0 && (($params{year} % 100 != 0) || $params{year} % 400 == 0)); } #}}} @@ -196,9 +197,9 @@ EOF add_depends($params{page}, join(" or ", @list)); return $calendar; -} +} #}}} -sub format_year (@) { +sub format_year (@) { #{{{ my %params=@_; my $pagespec = $params{pages}; @@ -299,9 +300,9 @@ EOF EOF return $calendar; -} +} #}}} -sub preprocess (@) { +sub preprocess (@) { #{{{ my %params=@_; $params{pages} = "*" unless defined $params{pages}; $params{type} = "month" unless defined $params{type}; @@ -363,6 +364,6 @@ sub preprocess (@) { } return "\n
$calendar
\n"; -} +} #}} 1