summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 24d4afc)
raw | patch | inline | side by side (parent: 24d4afc)
author | John 'Warthog9' Hawley <warthog9@kernel.org> | |
Sat, 30 Jan 2010 22:30:42 +0000 (23:30 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 30 Jan 2010 23:53:54 +0000 (15:53 -0800) |
Add a function (named format_local_time) that returns the string that
print_local_time would print.
Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
print_local_time would print.
Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a4148d36ae2e1400d979077834366fa617812468..debaf55e82a56326e89428bcd019d669d68a6d1d 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
}
sub print_local_time {
+ print format_local_time(@_);
+}
+
+sub format_local_time {
+ my $localtime = '';
my %date = @_;
if ($date{'hour_local'} < 6) {
- printf(" (<span class=\"atnight\">%02d:%02d</span> %s)",
+ $localtime .= sprintf(" (<span class=\"atnight\">%02d:%02d</span> %s)",
$date{'hour_local'}, $date{'minute_local'}, $date{'tz_local'});
} else {
- printf(" (%02d:%02d %s)",
+ $localtime .= sprintf(" (%02d:%02d %s)",
$date{'hour_local'}, $date{'minute_local'}, $date{'tz_local'});
}
+
+ return $localtime;
}
# Outputs the author name and date in long form