make relativedate work for the dates on the recentchanges page
authorJoey Hess <joey@kodama.kitenet.net>
Sat, 18 Oct 2008 01:21:07 +0000 (21:21 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sat, 18 Oct 2008 01:21:07 +0000 (21:21 -0400)
Having a always current relative date on recentchanges is very, very nice.

IkiWiki/Plugin/recentchanges.pm
templates/change.tmpl

index eb23b184b7f151ac95513e80c5a3b8a6fd99985c..d25c7abff87e515ae3ad109a31845da71b5f924a 100644 (file)
@@ -173,6 +173,7 @@ sub store ($$$) { #{{{
        $template->param(
                %$change,
                commitdate => displaytime($change->{when}, "%X %x"),
+               commitdate_raw => scalar localtime($change->{when}),
                wikiname => $config{wikiname},
        );
        IkiWiki::run_hooks(pagetemplate => sub {
index 4a99cf5ff47a457774e686d1cbd0c320c142d363..3a1086cf083a64c00d0091629582936161fcdb9d 100644 (file)
@@ -24,7 +24,7 @@
 <span class="desc"><br />Commit type:</span>
 <span class="committype"><TMPL_VAR COMMITTYPE></span>
 <span class="desc"><br />Date:</span>
-<span class="changedate"><TMPL_VAR COMMITDATE></span>
+<span class="changedate"><span class="date" title="<TMPL_VAR COMMITDATE_RAW>"><TMPL_VAR COMMITDATE></span></span>
 </div>
 <div class=changelog>
 <TMPL_LOOP NAME="MESSAGE">