]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: JavaScript ability to adjust time based on timezone
[Gitweb] / gitweb.perl
index ca3d1a95c570b1a381a6c65e246da9d5e94156c40fc471771d8e422c80c3986f..ddf8ad212a98d2704ccb7858978c5217c83ebc91f7704da79c6d5fe635a011fa 100755 (executable)
@@ -3886,9 +3886,14 @@ sub git_footer_html {
                      qq!startBlame("!. href(action=>"blame_data", -replay=>1) .qq!",\n!.
                      qq!           "!. href() .qq!");\n!.
                      qq!</script>\n!;
-       } elsif (gitweb_check_feature('javascript-actions')) {
+       } else {
                print qq!<script type="text/javascript">\n!.
-                     qq!window.onload = fixLinks;\n!.
+                     qq!window.onload = function () {\n!.
+                     (gitweb_check_feature('javascript-actions') ?
+                     qq!       fixLinks();\n! : '').
+                     # last parameter to onloadTZSetup must be CSS class used by format_timestamp_html
+                     qq!       onloadTZSetup('local', 'gitweb_tz', 'datetime');\n!.
+                     qq!};\n!.
                      qq!</script>\n!;
        }
 
@@ -4094,7 +4099,7 @@ sub git_print_section {
 
 sub format_timestamp_html {
        my $date = shift;
-       my $strtime = $date->{'rfc2822'};
+       my $strtime = '<span class="datetime">'.$date->{'rfc2822'}.'</span>';
 
        my $localtime_format = '(%02d:%02d %s)';
        if ($date->{'hour_local'} < 6) {
This page took 0.325758 seconds and 4 git commands to generate.