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 <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jakub Narebski committed
Apr 28, 2011 at 21:04 UTC
ce71b07632c71c2e6f4732abd3db6d59fb1bb924
1 file changed
+3
-5
gitweb/gitweb.perl
+3
-5
@@ -3939,11 +3939,9 @@ sub git_print_section {
3939
}
3940
3941
sub format_timestamp_html {
3942
- my ($date, %opts) = @_;
3942
+ my $date = shift;
3943
my $strtime = $date->{'rfc2822'};
3944
3945
- return $strtime unless $opts{'-localtime'};
3946
-
3945
my $localtime_format = '(%02d:%02d %s)';
3946
if ($date->{'hour_local'} < 6) {
3947
$localtime_format = '(<span class="atnight">%02d:%02d</span> %s)';
@@ -3965,7 +3963,7 @@ sub git_print_authorship {
3963
my %ad = parse_date($co->{'author_epoch'}, $co->{'author_tz'});
3964
print "<$tag class=\"author_date\">" .
3965
format_search_author($author, "author", esc_html($author)) .
3968
- " [".format_timestamp_html(\%ad, %opts)."]".
3966
+ " [".format_timestamp_html(\%ad)."]".
3967
git_get_avatar($co->{'author_email'}, -pad_before => 1) .
3968
"</$tag>\n";
3969
}
@@ -3992,7 +3990,7 @@ sub git_print_authorship_rows {
3990
"</td></tr>\n" .
3991
"<tr>" .
3992
"<td></td><td>" .
3995
- format_timestamp_html(\%wd, -localtime=>1) .
3993
+ format_timestamp_html(\%wd) .
3994
"</td>" .
3995
"</tr>\n";
3996
}