aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/calendar.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-12-02 12:58:45 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-12-02 12:58:45 -0500
commitf02f806cf70ed19c9e9aa70e232ca46398b3538a (patch)
treefdd892e392f66e610ed344ddc353185396de13a4 /IkiWiki/Plugin/calendar.pm
parent092877335cf0994fc1066e74309f698b2a101f76 (diff)
downloadikiwiki-f02f806cf70ed19c9e9aa70e232ca46398b3538a.tar
ikiwiki-f02f806cf70ed19c9e9aa70e232ca46398b3538a.tar.gz
calendar: Fix month wraparound error that broke in December.
Diffstat (limited to 'IkiWiki/Plugin/calendar.pm')
-rw-r--r--IkiWiki/Plugin/calendar.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm
index cbbb57e98..77fd50827 100644
--- a/IkiWiki/Plugin/calendar.pm
+++ b/IkiWiki/Plugin/calendar.pm
@@ -396,8 +396,14 @@ sub preprocess (@) {
}
elsif ($params{type} eq 'year' && $params{year} == $thisyear) {
# calendar for current year, updates 1st of next month
- $pagestate{$params{destpage}}{calendar}{nextchange}=
- timelocal(0, 0, 0, 1, $thismonth+1-1, $params{year});
+ if ($thismonth < 12) {
+ $pagestate{$params{destpage}}{calendar}{nextchange}=
+ timelocal(0, 0, 0, 1, $thismonth+1-1, $params{year});
+ }
+ else {
+ $pagestate{$params{destpage}}{calendar}{nextchange}=
+ timelocal(0, 0, 0, 1, 1-1, $params{year}+1);
+ }
}
elsif ($params{type} eq 'year' && $params{year} > $thisyear) {
# calendar for upcoming year, updates 1st of that year