Skip to content

Commit

Permalink
gitweb: Add local time and timezone to git_print_authorship
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Aug 28, 2006
1 parent b4657e7 commit a44465c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1358,10 +1358,18 @@ sub git_print_header_div {
sub git_print_authorship {
my $co = shift;

my %ad = parse_date($co->{'author_epoch'});
my %ad = parse_date($co->{'author_epoch'}, $co->{'author_tz'});
print "<div class=\"author_date\">" .
esc_html($co->{'author_name'}) .
" [$ad{'rfc2822'}]</div>\n";
" [$ad{'rfc2822'}";
if ($ad{'hour_local'} < 6) {
printf(" (<span class=\"atnight\">%02d:%02d</span> %s)",
$ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
} else {
printf(" (%02d:%02d %s)",
$ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
}
print "]</div>\n";
}

sub git_print_page_path {
Expand Down

0 comments on commit a44465c

Please sign in to comment.