* [PATCH] view: simplify timestamp generation
@ 2015-07-29 18:11 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-07-29 18:11 UTC (permalink / raw)
To: meta
It's seems less ambiguous to parse a consistent in quiet lists
where messages are sparse.
---
lib/PublicInbox/View.pm | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index bc4c7ac..c65e468 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -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";
--
EW
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-29 18:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-29 18:11 [PATCH] view: simplify timestamp generation Eric Wong
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 read-only IMAP folder(s) and NNTP newsgroup(s).