Skip to content

Commit

Permalink
Tweak end date for updates to avoid redundant data
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Dec 9, 2022
1 parent 41ffd8f commit 6e554aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/apps/ConvertUpdates.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ private static Pair<String, String> getUpdates(String startOfUpdates, String end
String start = startOfUpdates;
String givenEndOrToday = endOfUpdates != null ? endOfUpdates
: LocalDateTime.now().format(DateTimeFormatter.ISO_DATE);
String end = addDays(start, givenEndOrToday, intervalSize);
String end = addDays(start, givenEndOrToday,
intervalSize - 1 /* 'until' is inclusive */);
int intervals = calculateIntervals(startOfUpdates, givenEndOrToday,
intervalSize);
File file = new File(config("data.updates.rdf"));
Expand All @@ -109,7 +110,8 @@ private static Pair<String, String> getUpdates(String startOfUpdates, String end
if (i == intervals - 2)
end = givenEndOrToday;
else
end = addDays(end, givenEndOrToday, intervalSize);
end = addDays(end, givenEndOrToday,
intervalSize - 1 /* 'until' is inclusive */);
}
try (FileWriter writer = new FileWriter(file, true)) {
writer.write("</RDF>");
Expand Down

0 comments on commit 6e554aa

Please sign in to comment.