From 264a82a435b9ce5560f4bbea7b53270c53ef5720 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 13 Nov 2007 16:14:48 -0500 Subject: * inline: Add timeformat parameter to control how the ctime of inlined pages is displayed. Closes: #451019 --- IkiWiki.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'IkiWiki.pm') diff --git a/IkiWiki.pm b/IkiWiki.pm index 5ae360ad0..ad4d26741 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -498,13 +498,16 @@ sub abs2rel ($$) { #{{{ return $ret; } #}}} -sub displaytime ($) { #{{{ +sub displaytime ($;$) { #{{{ my $time=shift; + my $format=shift; + if (! defined $format) { + $format=$config{timeformat}; + } # strftime doesn't know about encodings, so make sure # its output is properly treated as utf8 - return decode_utf8(POSIX::strftime( - $config{timeformat}, localtime($time))); + return decode_utf8(POSIX::strftime($format, localtime($time))); } #}}} sub beautify_url ($) { #{{{ -- cgit v1.2.3