about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-12-05 02:08:01 +0000
committerEric Wong <e@80x24.org>2015-12-05 02:16:55 +0000
commitc0805dfcd9a7b077c6ac4fa2cec31af60d50133e (patch)
treefb5036e6d67ac0e1a58b91d1968955833b32cc5a /lib/PublicInbox/View.pm
parent5bf2748a96a2ef3d1c49ff5b5354c65fd82b7545 (diff)
downloadpublic-inbox-c0805dfcd9a7b077c6ac4fa2cec31af60d50133e.tar.gz
Avoid the visual noise entirely by using a space instead.

I sometimes have difficulty distinguishing '0' from '8' while
other users may mistake it for an 'O' character.  Most digital
clocks I've seen will omit displaying a leading zero for the
hour, too.

This may also save transfer time by allowing better compression
(since there is a space between the date and time anyways) and
perhaps reduce client rendering time on some displays.

We'll leave the leading zero for minutes since that seems pretty
standard for digital clocks.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r--lib/PublicInbox/View.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index f34e1f36..2506c954 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -712,9 +712,11 @@ sub missing_thread {
 sub _msg_date {
         my ($mime) = @_;
         my $ts = $mime->header('X-PI-TS') || msg_timestamp($mime);
-        POSIX::strftime('%Y-%m-%d %H:%M', gmtime($ts));
+        fmt_ts($ts);
 }
 
+sub fmt_ts { POSIX::strftime('%Y-%m-%d %k:%M', gmtime($_[0])) }
+
 sub _inline_header {
         my ($dst, $state, $upfx, $mime, $level) = @_;
         my $pfx = INDENT x ($level - 1);
@@ -865,7 +867,7 @@ sub dump_topics {
                 $dst .= "$nl$pfx$dot<a\nhref=\"$mid/t/#u\"><b>$subj</b></a>\n";
 
                 my $attr;
-                $ts = POSIX::strftime('%Y-%m-%d %H:%M', gmtime($ts));
+                $ts = fmt_ts($ts);
                 if ($n == 1) {
                         $attr = "@ $ts UTC";
                         $n = "";