From 2d3dc86d07a7ebf5f638084259ae2d9c2c63e6b6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 28 Jan 2008 23:48:27 -0500 Subject: * prettydate,ddate: Don't ignore time formats passed to displaytime function. --- IkiWiki/Plugin/ddate.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Plugin/ddate.pm') diff --git a/IkiWiki/Plugin/ddate.pm b/IkiWiki/Plugin/ddate.pm index 6b67f4202..d081cb509 100644 --- a/IkiWiki/Plugin/ddate.pm +++ b/IkiWiki/Plugin/ddate.pm @@ -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 -- cgit v1.2.3