diff --git a/app/src/main/java/ua/samosfator/moduleok/notification/NearbyModules.java b/app/src/main/java/ua/samosfator/moduleok/notification/NearbyModules.java index 9e30d77..011d8aa 100644 --- a/app/src/main/java/ua/samosfator/moduleok/notification/NearbyModules.java +++ b/app/src/main/java/ua/samosfator/moduleok/notification/NearbyModules.java @@ -58,10 +58,11 @@ private static void filterPastDates() { private static void filterDatesInTwoDayPeriod() { long currentTime = new Date().getTime(); - int twoDaysMilliseconds = 172800000; + int oneDayMilliseconds = 86400000; + int twoDaysMilliseconds = oneDayMilliseconds * 2; modulesDates = StreamSupport.stream(modulesDates) - .filter(modulesDate -> (modulesDate.getTime() - currentTime) < twoDaysMilliseconds) + .filter(modulesDate -> (modulesDate.getTime() - currentTime) < twoDaysMilliseconds || (currentTime - modulesDate.getTime()) < oneDayMilliseconds) .collect(Collectors.toList()); } }