diff options
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Render.pm | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 8b67bfa61..6ecdf0d38 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -62,7 +62,7 @@ sub preprocess_inline (@) { #{{{ $template->param(pagelink => htmllink($params{page}, $params{page}, $page)); $template->param(content => get_inline_content($params{page}, $page)) if $params{archive} eq "no"; - $template->param(ctime => scalar(gmtime($pagectime{$page}))); + $template->param(ctime => displaytime($pagectime{$page})); $ret.=$template->output; } diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index df08eb49c..c5922c933 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -202,7 +202,7 @@ sub genpage ($$$) { #{{{ parentlinks => [parentlinks($page)], content => $content, backlinks => [backlinks($page)], - mtime => scalar(gmtime($mtime)), + mtime => displaytime($mtime), styleurl => styleurl($page), ); @@ -223,6 +223,18 @@ sub check_overwrite ($$) { #{{{ } } #}}} +sub displaytime ($) { #{{{ + my $time=shift; + + if ($config{timeformat} eq '%c') { + return scalar(localtime($time)); # optimisation + } + else { + eval q{use POSIX}; + return POSIX::strftime($config{timeformat}, localtime($time)); + } +} #}}} + sub mtime ($) { #{{{ my $file=shift; |