}
sub import { #{{{
- hook(type => "checkconfig", id => "skeleton", call => \&checkconfig);
+ hook(type => "checkconfig", id => "prettydate", call => \&checkconfig);
} # }}}
sub checkconfig () { #{{{
}
} #}}}
-sub IkiWiki::displaytime ($) { #{{{
+sub IkiWiki::displaytime ($;$) { #{{{
my $time=shift;
+ my $format=shift;
+ if (! defined $format) {
+ $format=$config{prettydateformat};
+ }
eval q{use Date::Format};
error($@) if $@;
$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);
} #}}}