From 0074d4336472e72d753c8b16700d26f197d8bfc2 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Sat, 10 Dec 2022 13:52:33 +0100 Subject: [PATCH] fixed problem "showing task multiple times in in schedule" --- .../java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java b/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java index 74d67dd..dfd69ba 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java @@ -181,6 +181,7 @@ public class GardenSchedule { do { if (date.equals(task.getNextExecution()) || (date.equals(checkDate) && !date.isAfter(task.getEndDate().orElse(LocalDate.MIN)))) { dayTaskList.get(finalI).add(task); + break; } checkDate = checkDate.plusDays(task.getInterval().orElse(0)); } while (!(task.getInterval().orElse(0) == 0) && checkDate.isBefore(LocalDate.now().plusDays(listLength)));