]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb.js: Add UI for selecting common timezone to display dates
[Gitweb] / gitweb.perl
index ca3d1a95c570b1a381a6c65e246da9d5e94156c40fc471771d8e422c80c3986f..79808b84d1fa9d50c595b49d112c3f12ab751f3a6fe76e1358da605cd361e2af 100755 (executable)
@@ -3886,9 +3886,15 @@ 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!       var tz_cookie = { name: 'gitweb_tz', expires: 14, path: '/' };\n!. # in days
+                     qq!       onloadTZSetup('local', tz_cookie, 'datetime');\n!.
+                     qq!};\n!.
                      qq!</script>\n!;
        }
 
@@ -4094,7 +4100,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.2993 seconds and 4 git commands to generate.