Console: Limit age of news entries displayed

This commit is contained in:
zzz
2016-12-22 12:03:28 +00:00
parent 0819857b86
commit e625e67b5d
3 changed files with 17 additions and 7 deletions

View File

@@ -637,8 +637,13 @@ class SummaryBarRenderer {
// the router sets the JVM time zone to UTC but saves the original here so we can get it
fmt.setTimeZone(SystemVersion.getSystemTimeZone(_context));
int i = 0;
final int max = 2;
// show a min of 1, max of 3, none older than 60 days over min
final int min = 1;
final int max = 3;
for (NewsEntry entry : entries) {
if (i >= min && entry.updated > 0 &&
entry.updated < _context.clock().now() - 60*24*60*60*1000L)
break;
buf.append("<li><a href=\"/?news=1&amp;consoleNonce=")
.append(consoleNonce)
.append("\">");