Change the time markup
authorChris Morgan <me@chrismorgan.info>
committerChris Morgan <me@chrismorgan.info>
I didn’t much like the old. This is still imperfect, but somewhat
better. (Note that javascsript-timezone clobbers the title attribute.)
gitweb.cgi

index 1de74b658fa613e490aea3ac12eb3a6c533fd8e1..43fcbc748718937087a161e1d9cfa138b1ceb4b7 100755 (executable)
@@ -4540,18 +4540,14 @@ sub git_print_section {
 
 sub format_timestamp_html {
        my $date = shift;
-       my $strtime = $date->{'rfc2822'};
 
        my (undef, undef, $datetime_class) =
                gitweb_get_feature('javascript-timezone');
+       my $strtime = qq!<time datetime="$date->{'iso-8601'}" title="$date->{'iso-tz'}"!;
        if ($datetime_class) {
-               $strtime = qq!<span class="$datetime_class">$strtime</span>!;
+               $strtime .= qq! class="$datetime_class"!;
        }
-
-       my $localtime_format = '(%02d:%02d %s)';
-       $strtime .= ' ' .
-                   sprintf($localtime_format,
-                           $date->{'hour_local'}, $date->{'minute_local'}, $date->{'tz_local'});
+       $strtime .= qq!>$date->{'rfc2822'}</time>!;
 
        return $strtime;
 }