From 3d36c85941d03b4814276b8cfb769709617726fa Mon Sep 17 00:00:00 2001 From: giavaphi Date: Mon, 28 Nov 2022 11:57:28 +0100 Subject: [PATCH] temp style css --- .../java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java | 3 +-- src/main/java/ch/zhaw/gartenverwaltung/types/TaskTemplate.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java b/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java index 9cb6503..a3eccfa 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java @@ -151,9 +151,8 @@ public class GardenSchedule { if (date.equals(checkDate) && !date.isAfter(task.getEndDate().orElse(LocalDate.MIN))) { dayTaskList.get(finalI).add(task); } - if (task.getInterval().orElse(0) == 0) break; checkDate = checkDate.plusDays(task.getInterval().orElse(0)); - } while (task.getInterval().isPresent() && checkDate.isBefore(LocalDate.now().plusDays(listLength))); + } while (!(task.getInterval().orElse(0) == 0) && checkDate.isBefore(LocalDate.now().plusDays(listLength))); }); } return dayTaskList; diff --git a/src/main/java/ch/zhaw/gartenverwaltung/types/TaskTemplate.java b/src/main/java/ch/zhaw/gartenverwaltung/types/TaskTemplate.java index 9a3d57d..39e349f 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/types/TaskTemplate.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/types/TaskTemplate.java @@ -42,7 +42,7 @@ public class TaskTemplate { } public Task generateTask(LocalDate realStartDate, long cropId) { - LocalDate endDate = relativeEndDate != null ? realStartDate.plusDays(relativeEndDate) : realStartDate.plusDays(0); + LocalDate endDate = relativeEndDate != null ? realStartDate.plusDays(relativeEndDate) : realStartDate; if (interval == null) { this.interval = 0;