migrate from java.util.Date to java.time

This commit is contained in:
Athou
2024-01-08 20:42:45 +01:00
parent b1a4debb95
commit 69c9988404
35 changed files with 203 additions and 206 deletions

View File

@@ -1,10 +1,9 @@
package com.commafeed;
import java.util.Date;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.ResourceBundle;
import org.apache.commons.lang3.time.DateUtils;
import com.commafeed.backend.cache.RedisPoolFactory;
import com.commafeed.frontend.session.SessionHandlerFactory;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -175,9 +174,8 @@ public class CommaFeedConfiguration extends Configuration implements WebsocketBu
private Duration treeReloadInterval = Duration.seconds(30);
public Date getUnreadThreshold() {
int keepStatusDays = getKeepStatusDays();
return keepStatusDays > 0 ? DateUtils.addDays(new Date(), -1 * keepStatusDays) : null;
public Instant getUnreadThreshold() {
return getKeepStatusDays() > 0 ? Instant.now().minus(getKeepStatusDays(), ChronoUnit.DAYS) : null;
}
}