Skip to content

Commit

Permalink
Check for modules day after target date
Browse files Browse the repository at this point in the history
  • Loading branch information
vladholubiev committed Feb 12, 2015
1 parent 98d8098 commit 3dd6580
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

0 comments on commit 3dd6580

Please sign in to comment.