]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/relativedate.pm
po: clarify code with some comments
[git.ikiwiki.info.git] / IkiWiki / Plugin / relativedate.pm
index 0c9426dda074fc5eb2ded88d82e8387b88e58414..dc8f7d538a726f5689b6c9b51ddeb4691cc1750f 100644 (file)
@@ -12,6 +12,7 @@ sub import { #{{{
        add_underlay("javascript");
        hook(type => "getsetup", id => "relativedate", call => \&getsetup);
        hook(type => "format", id => "relativedate", call => \&format);
+       inject(name => "IkiWiki::displaytime", call => \&mydisplaytime);
 } # }}}
 
 sub getsetup () { #{{{
@@ -42,7 +43,7 @@ sub include_javascript ($;$) { #{{{
                '" type="text/javascript" charset="utf-8"></script>';
 } #}}}
 
-sub IkiWiki::displaytime ($;$) { #{{{
+sub mydisplaytime ($;$) { #{{{
        my $time=shift;
        my $format=shift;
 
@@ -52,7 +53,7 @@ sub IkiWiki::displaytime ($;$) { #{{{
        my $gmtime=decode_utf8(POSIX::strftime("%a, %d %b %Y %H:%M:%S %z",
                        localtime($time)));
 
-       return '<span class="date" title="'.$gmtime.'">'.
+       return '<span class="relativedate" title="'.$gmtime.'">'.
                IkiWiki::formattime($time, $format).'</span>';
 } #}}}