]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/calendar.pm
reorder canedit checks during page creation to have best_loc first
[ikiwiki.git] / IkiWiki / Plugin / calendar.pm
index cbbb57e98c803d51cdf25d06eef3e88afe2d33af..2b87451ce2fc304e300fa62b98276c5bc9dd8b2c 100644 (file)
@@ -137,7 +137,7 @@ sub format_month (@) {
                $purl = htmllink($params{page}, $params{destpage}, 
                        "$archivebase/$pyear/$pmonth",
                        noimageinline => 1,
-                       linktext => "\&larr",
+                       linktext => "\←",
                        title => $pmonthname);
        }
        add_depends($params{page}, "$archivebase/$pyear/$pmonth",
@@ -146,7 +146,7 @@ sub format_month (@) {
                $nurl = htmllink($params{page}, $params{destpage}, 
                        "$archivebase/$nyear/$nmonth",
                        noimageinline => 1,
-                       linktext => "\&rarr",
+                       linktext => "\→",
                        title => $nmonthname);
        }
        add_depends($params{page}, "$archivebase/$nyear/$nmonth",
@@ -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