X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4db40b4e59c1e735e4176f3e82b825e895306c4c..6afbd9939ac8cd171e7cf8376f0d0c0a4bf3d516:/IkiWiki/Plugin/prettydate.pm?ds=inline diff --git a/IkiWiki/Plugin/prettydate.pm b/IkiWiki/Plugin/prettydate.pm index b31d30cd0..745e6a1de 100644 --- a/IkiWiki/Plugin/prettydate.pm +++ b/IkiWiki/Plugin/prettydate.pm @@ -40,7 +40,7 @@ sub default_timetable { } sub import { #{{{ - hook(type => "checkconfig", id => "skeleton", call => \&checkconfig); + hook(type => "checkconfig", id => "prettydate", call => \&checkconfig); } # }}} sub checkconfig () { #{{{ @@ -63,6 +63,10 @@ sub checkconfig () { #{{{ sub IkiWiki::displaytime ($;$) { #{{{ my $time=shift; + my $format=shift; + if (! defined $format) { + $format=$config{prettydateformat}; + } eval q{use Date::Format}; error($@) if $@; @@ -93,7 +97,6 @@ sub IkiWiki::displaytime ($;$) { #{{{ $t=~s{\%A-}{my @yest=@t; $yest[6]--; strftime("%A", \@yest)}eg; - my $format=$config{prettydateformat}; $format=~s/\%X/$t/g; return strftime($format, \@t); } #}}}