From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: John 'Warthog9' Hawley <warthog9@eaglescrag.net>,
Kevin Cernekee <cernekee@gmail.com>,
Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH 08/11] gitweb: Unify the way long timestamp is displayed
Date: Fri, 15 Apr 2011 16:44:02 +0200 [thread overview]
Message-ID: <1302878645-458-9-git-send-email-jnareb@gmail.com> (raw)
In-Reply-To: <1302878645-458-1-git-send-email-jnareb@gmail.com>
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>
---
This patch is unchanged from v1 version.
It was marked in previous version of this series as an RFC, because I
wasn't sure about the look of gitweb after this patch... but it grew
up on me (well, I have a few doubts about new look of 'summary' page).
gitweb/gitweb.perl | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 7329db2..67bcfe8 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3939,11 +3939,9 @@ sub git_print_section {
}
sub format_timestamp_html {
- my ($date, %opts) = @_;
+ my $date = shift;
my $strtime = $date->{'rfc2822'};
- return $strtime unless $opts{'-localtime'};
-
my $localtime_format = '(%02d:%02d %s)';
if ($date->{'hour_local'} < 6) {
$localtime_format = '(<span class="atnight">%02d:%02d</span> %s)';
@@ -3965,7 +3963,7 @@ sub git_print_authorship {
my %ad = parse_date($co->{'author_epoch'}, $co->{'author_tz'});
print "<$tag class=\"author_date\">" .
format_search_author($author, "author", esc_html($author)) .
- " [".format_timestamp_html(\%ad, %opts)."]".
+ " [".format_timestamp_html(\%ad)."]".
git_get_avatar($co->{'author_email'}, -pad_before => 1) .
"</$tag>\n";
}
@@ -3992,7 +3990,7 @@ sub git_print_authorship_rows {
"</td></tr>\n" .
"<tr>" .
"<td></td><td>" .
- format_timestamp_html(\%wd, -localtime=>1) .
+ format_timestamp_html(\%wd) .
"</td>" .
"</tr>\n";
}
--
1.7.3
next prev parent reply other threads:[~2011-04-15 14:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-15 14:43 [PATCHv2 00/11] gitweb: Change timezone in dates using JavaScript Jakub Narebski
2011-04-15 14:43 ` [PATCH 01/11] gitweb: Split JavaScript for maintability, combining on build Jakub Narebski
2011-04-15 14:43 ` [PATCH 02/11] gitweb.js: Update and improve comments in JavaScript files Jakub Narebski
2011-04-15 14:43 ` [PATCH 03/11] gitweb.js: Provide default values for padding in padLeftStr and padLeft Jakub Narebski
2011-04-15 14:43 ` [PATCH 04/11] gitweb.js: Extract and improve datetime handling Jakub Narebski
2011-04-15 14:43 ` [PATCH 05/11] gitweb.js: Introduce gitweb/static/js/lib/cookies.js Jakub Narebski
2011-04-15 14:44 ` [PATCH 06/11] gitweb.js: Provide getElementsByClassName method (if it not exists) Jakub Narebski
2011-04-15 14:44 ` [PATCH 07/11] gitweb: Refactor generating of long dates into format_timestamp_html Jakub Narebski
2011-04-15 14:44 ` Jakub Narebski [this message]
2011-04-15 14:44 ` [PATCH 09/11] gitweb: JavaScript ability to adjust time based on timezone Jakub Narebski
2011-04-15 14:44 ` [PATCHv2/RFC 10/11] gitweb.js: Add UI for selecting common timezone to display dates Jakub Narebski
2011-04-15 17:43 ` Jakub Narebski
2011-04-15 18:06 ` Jakub Narebski
2011-04-15 19:17 ` [PATCHv3 " Jakub Narebski
2011-04-15 14:44 ` [PATCHv2/RFC 11/11] gitweb: Make JavaScript ability to adjust timezones configurable Jakub Narebski
2011-04-19 1:01 ` [PATCHv2 00/11] gitweb: Change timezone in dates using JavaScript Junio C Hamano
2011-04-19 1:26 ` Jakub Narebski
2011-04-19 6:36 ` Jakub Narebski
2011-04-19 16:58 ` Junio C Hamano
2011-04-19 17:18 ` [PATCH 12/11] Remove gitweb/gitweb.cgi and other legacy targets from main Makefile Jakub Narebski
2011-04-19 11:54 ` [PATCH -01/11] git-instaweb: Simplify build dependency on gitweb Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1302878645-458-9-git-send-email-jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=cernekee@gmail.com \
--cc=git@vger.kernel.org \
--cc=warthog9@eaglescrag.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).