Skip to content

Commit ce71b07

Browse files
jnarebgitster
authored andcommitted
gitweb: Unify the way long timestamp is displayed
format_timestamp_html loses its "-localtime => 1" option, and now always print the local time (in author/comitter/tagger local timezone), with "atnight" warning if needed. This means that both 'summary' and 'log' views now display localtime. In the case of 'log' view this can be thought as an improvement, as now one can easily see which commits in a series are made "atnight" and should be examined closer. Signed-off-by: Jakub Narebski <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 256b7b4 commit ce71b07

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

gitweb/gitweb.perl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3939,11 +3939,9 @@ sub git_print_section {
39393939
}
39403940

39413941
sub format_timestamp_html {
3942-
my ($date, %opts) = @_;
3942+
my $date = shift;
39433943
my $strtime = $date->{'rfc2822'};
39443944

3945-
return $strtime unless $opts{'-localtime'};
3946-
39473945
my $localtime_format = '(%02d:%02d %s)';
39483946
if ($date->{'hour_local'} < 6) {
39493947
$localtime_format = '(<span class="atnight">%02d:%02d</span> %s)';
@@ -3965,7 +3963,7 @@ sub git_print_authorship {
39653963
my %ad = parse_date($co->{'author_epoch'}, $co->{'author_tz'});
39663964
print "<$tag class=\"author_date\">" .
39673965
format_search_author($author, "author", esc_html($author)) .
3968-
" [".format_timestamp_html(\%ad, %opts)."]".
3966+
" [".format_timestamp_html(\%ad)."]".
39693967
git_get_avatar($co->{'author_email'}, -pad_before => 1) .
39703968
"</$tag>\n";
39713969
}
@@ -3992,7 +3990,7 @@ sub git_print_authorship_rows {
39923990
"</td></tr>\n" .
39933991
"<tr>" .
39943992
"<td></td><td>" .
3995-
format_timestamp_html(\%wd, -localtime=>1) .
3993+
format_timestamp_html(\%wd) .
39963994
"</td>" .
39973995
"</tr>\n";
39983996
}

0 commit comments

Comments
 (0)