Skip to content
Snippets Groups Projects
Commit fa52e2ac authored by dawoo's avatar dawoo
Browse files

ein Paar Einträge haben keine Growthduration, deshalb habe ich die methode angepasst

parent af3c69b4
No related branches found
No related tags found
1 merge request!36getPlantsReadyToHarvest Methode erstellt, es ermöglicht die Benachrichtigung...
......@@ -121,8 +121,10 @@ public class GrandmaService {
int growthDuration = entry.getPlant().getGrowthDuration();
LocalDate createdAt = entry.getCreatedAt().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
LocalDate currentDate = LocalDate.now();
if(growthDuration >= ChronoUnit.WEEKS.between(createdAt,currentDate)){
plantsReadyToHarvest.add(entry);
if(growthDuration != 0 ) {
if (growthDuration >= ChronoUnit.WEEKS.between(createdAt, currentDate)) {
plantsReadyToHarvest.add(entry);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment