]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/calendar.pm
fix targetpage replacement to support 3 argument form
[git.ikiwiki.info.git] / IkiWiki / Plugin / calendar.pm
index 0bf933dcda9db2aedc0ccbb65a5b3f92223079e9..c7d2b7c01d8943f26e34e43231cc4ee26e0b6847 100644 (file)
@@ -49,7 +49,7 @@ sub getsetup () {
                },
                archive_pagespec => {
                        type => "pagespec",
-                       example => "posts/* and !*/Discussion",
+                       example => "page(posts/*) and !*/Discussion",
                        description => "PageSpec of pages to include in the archives; used by ikiwiki-calendar command",
                        link => 'ikiwiki/PageSpec',
                        safe => 1,
@@ -123,6 +123,7 @@ sub format_month (@) {
        }
 
        # Find out month names for this, next, and previous months
+       my $monthabbrev=POSIX::strftime("%b", @monthstart);
        my $monthname=POSIX::strftime("%B", @monthstart);
        my $pmonthname=POSIX::strftime("%B", localtime(timelocal(0,0,0,1,$pmonth-1,$pyear-1900)));
        my $nmonthname=POSIX::strftime("%B", localtime(timelocal(0,0,0,1,$nmonth-1,$nyear-1900)));
@@ -137,7 +138,7 @@ sub format_month (@) {
                $url = htmllink($params{page}, $params{destpage}, 
                        "$archivebase/$params{year}/".$params{month},
                        noimageinline => 1,
-                       linktext => "$monthname $params{year}",
+                       linktext => "$monthabbrev $params{year}",
                        title => $monthname);
        }
        add_depends($params{page}, "$archivebase/$params{year}/$params{month}",
@@ -182,7 +183,7 @@ EOF
        for my $dow ($week_start_day..$week_start_day+6) {
                my @day=localtime(timelocal(0,0,0,$start_day++,$params{month}-1,$params{year}-1900));
                my $downame = POSIX::strftime("%A", @day);
-               my $dowabbr = POSIX::strftime("%a", @day);
+               my $dowabbr = substr($downame, 0, 1);
                $downame{$dow % 7}=$downame;
                $dowabbr{$dow % 7}=$dowabbr;
                $calendar.= qq{\t\t<th class="month-calendar-day-head $downame" title="$downame">$dowabbr</th>\n};
@@ -490,6 +491,7 @@ sub needsbuild (@) {
                        }
                }
        }
+       return $needsbuild;
 }
 
 1