From 7e8064e9fa8b3f2c3c0bd0aa5458f00552398e06 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 20 Oct 2010 18:53:50 -0400 Subject: [PATCH] add a hint that creation_month takes a number, not a month name --- IkiWiki.pm | 6 +++--- doc/ikiwiki/pagespec.mdwn | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 941ee13c4..1fa89586e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -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'); diff --git a/doc/ikiwiki/pagespec.mdwn b/doc/ikiwiki/pagespec.mdwn index 6aec561ae..fe1af4c15 100644 --- a/doc/ikiwiki/pagespec.mdwn +++ b/doc/ikiwiki/pagespec.mdwn @@ -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 -- 2.44.0