* [PATCH 1/9] feed: remove unnecesary time paramenter in index state
@ 2015-08-17 3:38 6% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-08-17 3:38 UTC (permalink / raw)
To: meta
We no longer do "smart" time displays as of
commit ea0e8649f90d1fd0850a41c0ca16642faadf4f14
("view: simplify timestamp generation").
In retrospect, that commit also made us more cache-friendly, too.
---
lib/PublicInbox/Feed.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index b532559..1a89fba 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -76,7 +76,7 @@ sub generate_html_index {
$th->order(*PublicInbox::Thread::sort_ts);
# except we sort top-level messages reverse chronologically
- my $state = [ time, {}, $first, 0 ];
+ my $state = [ undef, {}, $first, 0 ];
for (PublicInbox::Thread::rsort_ts($th->rootset)) {
dump_msg($_, 0, \$html, $state)
}
--
EW
^ permalink raw reply related [relevance 6%]
* [PATCH] view: simplify timestamp generation
@ 2015-07-29 18:11 7% Eric Wong
0 siblings, 0 replies; 2+ results
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 [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-07-29 18:11 7% [PATCH] view: simplify timestamp generation Eric Wong
2015-08-17 3:38 [PATCH 0/9] search pushed and deployed to master Eric Wong
2015-08-17 3:38 6% ` [PATCH 1/9] feed: remove unnecesary time paramenter in index state Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).