gitweb: Add local time and timezone to git_print_authorship
Add local time (hours and minutes) and local timezone to the output of git_print_authorship command, used by git_commitdiff. The code was taken from git_commit subroutine. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jakub Narebski committed
Aug 28, 2006 at 23:17 UTC
a44465ccd998bcb6fbfb49cb63d5206dce26051a
1 file changed
+10
-2
gitweb/gitweb.perl
+10
-2
@@ -1358,10 +1358,18 @@ sub git_print_header_div {
1358
sub git_print_authorship {
1359
my $co = shift;
1360
1361
- my %ad = parse_date($co->{'author_epoch'});
1361
+ my %ad = parse_date($co->{'author_epoch'}, $co->{'author_tz'});
1362
print "<div class=\"author_date\">" .
1363
esc_html($co->{'author_name'}) .
1364
- " [$ad{'rfc2822'}]</div>\n";
1364
+ " [$ad{'rfc2822'}";
1365
+ if ($ad{'hour_local'} < 6) {
1366
+ printf(" (<span class=\"atnight\">%02d:%02d</span> %s)",
1367
+ $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
1368
+ } else {
1369
+ printf(" (%02d:%02d %s)",
1370
+ $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
1371
+ }
1372
+ print "]</div>\n";
1373
}
1374
1375
sub git_print_page_path {