]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: simplify timestamp generation
authorEric Wong <e@80x24.org>
Wed, 29 Jul 2015 18:09:41 +0000 (18:09 +0000)
committerEric Wong <e@80x24.org>
Wed, 29 Jul 2015 18:09:41 +0000 (18:09 +0000)
It's seems less ambiguous to parse a consistent in quiet lists
where messages are sparse.

lib/PublicInbox/View.pm

index bc4c7ac70cfd90831c625ba8fb1189ab6bdb5614..c65e4684d27587ae26e0410e04f117dd72770926 100644 (file)
@@ -68,14 +68,7 @@ sub index_entry {
        my $pfx = ('  ' x $level);
 
        my $ts = $mime->header('X-PI-Date');
-       my $time = '%H:%M UTC';
-       my $fmt = $time;
-       if ($now > ($ts + (365 * 24 * 60 * 60))) {
-               # doesn't have to be exactly 1 year
-               $fmt = '%Y/%m/%d ' . $time;
-       } elsif ($now > ($ts + (24 * 60 * 60))) {
-               $fmt = '%m/%d ' . $time;
-       }
+       my $fmt = '%Y-%m-%d %H:%M UTC';
        $ts = POSIX::strftime($fmt, gmtime($ts));
 
        $rv .= "$pfx<b\nid=\"$id\">$subj</b>\n$pfx";