]> sipb.mit.edu Git - ikiwiki.git/commitdiff
add a hint that creation_month takes a number, not a month name
authorJoey Hess <joey@kitenet.net>
Wed, 20 Oct 2010 22:53:50 +0000 (18:53 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 20 Oct 2010 23:07:46 +0000 (19:07 -0400)
IkiWiki.pm
doc/ikiwiki/pagespec.mdwn

index 941ee13c4d7cb6d7a76ea9643b133977f092e5e1..1fa89586efa279f18c0cbd220577fc9e0664215d 100644 (file)
@@ -2610,7 +2610,7 @@ sub match_created_after ($$;@) {
 sub match_creation_day ($$;@) {
        my $d=shift;
        if ($d !~ /^\d+$/) {
-               return IkiWiki::FailReason->new('invalid day');
+               return IkiWiki::ErrorReason->new("invalid day $d");
        }
        if ((localtime($IkiWiki::pagectime{shift()}))[3] == shift) {
                return IkiWiki::SuccessReason->new('creation_day matched');
@@ -2623,7 +2623,7 @@ sub match_creation_day ($$;@) {
 sub match_creation_month ($$;@) {
        my $m=shift;
        if ($m !~ /^\d+$/) {
-               return IkiWiki::FailReason->new('invalid month');
+               return IkiWiki::ErrorReason->new("invalid month $m");
        }
        if ((localtime($IkiWiki::pagectime{shift()}))[4] + 1 == shift) {
                return IkiWiki::SuccessReason->new('creation_month matched');
@@ -2636,7 +2636,7 @@ sub match_creation_month ($$;@) {
 sub match_creation_year ($$;@) {
        my $y=shift;
        if ($y !~ /^\d+$/) {
-               return IkiWiki::FailReason->new('invalid year');
+               return IkiWiki::ErrorReason->new("invalid year $y");
        }
        if ((localtime($IkiWiki::pagectime{shift()}))[5] + 1900 == $y) {
                return IkiWiki::SuccessReason->new('creation_year matched');
index 6aec561ae7f34ff986792cac4b3f38679a9d8cfb..fe1af4c153404c35aa21232c7d0f68ddfad55f6b 100644 (file)
@@ -32,6 +32,7 @@ Some more elaborate limits can be added to what matches using these functions:
   tags matched by a glob)
 * "`backlink(page)`" - matches only pages that a given page links to
 * "`creation_month(month)`" - matches only files created on the given month
+  number
 * "`creation_day(mday)`" - or day of the month
 * "`creation_year(year)`" - or year
 * "`created_after(page)`" - matches only files created after the given page