parent
1b8f1b867c
commit
2d3dc86d07
|
@ -18,6 +18,10 @@ sub checkconfig () { #{{{
|
|||
|
||||
sub IkiWiki::displaytime ($;$) { #{{{
|
||||
my $time=shift;
|
||||
my $format=shift;
|
||||
if (! defined $format) {
|
||||
$format=$config{timeformat};
|
||||
}
|
||||
eval q{
|
||||
use DateTime;
|
||||
use DateTime::Calendar::Discordian;
|
||||
|
@ -27,7 +31,7 @@ sub IkiWiki::displaytime ($;$) { #{{{
|
|||
}
|
||||
my $dt = DateTime->from_epoch(epoch => $time);
|
||||
my $dd = DateTime::Calendar::Discordian->from_object(object => $dt);
|
||||
return $dd->strftime($IkiWiki::config{timeformat});
|
||||
return $dd->strftime($format);
|
||||
} #}}}
|
||||
|
||||
5
|
||||
|
|
|
@ -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);
|
||||
} #}}}
|
||||
|
|
|
@ -19,6 +19,8 @@ ikiwiki (2.21) UNRELEASED; urgency=low
|
|||
* inline: The template can check for FIRST and LAST, which will be
|
||||
set for the first and last inlined page. Useful for templates that build
|
||||
tables and the like.
|
||||
* prettydate,ddate: Don't ignore time formats passed to displaytime
|
||||
function.
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Fri, 11 Jan 2008 15:09:37 -0500
|
||||
|
||||
|
|
Loading…
Reference in New Issue