]> sipb.mit.edu Git - ikiwiki.git/commitdiff
calendar: Fix month wraparound error that broke in December.
authorJoey Hess <joey@gnu.kitenet.net>
Wed, 2 Dec 2009 17:58:45 +0000 (12:58 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Wed, 2 Dec 2009 17:58:45 +0000 (12:58 -0500)
IkiWiki/Plugin/calendar.pm
debian/changelog

index cbbb57e98c803d51cdf25d06eef3e88afe2d33af..77fd508275d09896ff63d4d87220505526fbaf30 100644 (file)
@@ -396,8 +396,14 @@ sub preprocess (@) {
        }
        elsif ($params{type} eq 'year' && $params{year} == $thisyear) {
                # calendar for current year, updates 1st of next month
        }
        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
        }
        elsif ($params{type} eq 'year' && $params{year} > $thisyear) {
                # calendar for upcoming year, updates 1st of that year
index 2b468ca2ff98908281c8ce27f4d84e9967d67011..3afe89b59c92b6eb86b99d2cc324c011f13a7385 100644 (file)
@@ -14,6 +14,7 @@ ikiwiki (3.20091114) UNRELEASED; urgency=low
     modification date display, etc.
   * htmllink: Allow a title attribute to be specified.
   * calendar: Add title attributes for all links in the calendars.
     modification date display, etc.
   * htmllink: Allow a title attribute to be specified.
   * calendar: Add title attributes for all links in the calendars.
+  * calendar: Fix month wraparound error that broke in December.
 
  -- Joey Hess <joeyh@debian.org>  Mon, 16 Nov 2009 15:46:45 -0500
 
 
  -- Joey Hess <joeyh@debian.org>  Mon, 16 Nov 2009 15:46:45 -0500