issue-117 #119

Merged
sebastian merged 3 commits from issue-117 into master 2024-04-19 10:19:13 +02:00
Showing only changes of commit 57be3393c9 - Show all commits

View File

@ -62,6 +62,7 @@ public class TaskSeriesService {
List<AbstractSchedule> clonedSchedules = new ArrayList<>(); List<AbstractSchedule> clonedSchedules = new ArrayList<>();
LocalDate currentDate = rootTask.getStartDate().plusDays(offsetMap.get(rootTask)); LocalDate currentDate = rootTask.getStartDate().plusDays(offsetMap.get(rootTask));
long index = 1;
while(currentDate.isBefore(endingDate)) { while(currentDate.isBefore(endingDate)) {
var cloneResult = rootTask.cloneTask(); var cloneResult = rootTask.cloneTask();
Task clonedRootTask = cloneResult.getValue00(); Task clonedRootTask = cloneResult.getValue00();
@ -73,10 +74,11 @@ public class TaskSeriesService {
taskSerie.addItem(item); taskSerie.addItem(item);
} }
clonedRootTask.shiftTask(offsetMap.get(rootTask)); clonedRootTask.shiftTask(index * offsetMap.get(rootTask));
currentDate = currentDate.plusDays(offsetMap.get(rootTask)); currentDate = currentDate.plusDays(offsetMap.get(rootTask));
itemIndex += offsetMap.size(); itemIndex += offsetMap.size();
index++;
} }
return new Tupel<>(clonedTasks, clonedSchedules); return new Tupel<>(clonedTasks, clonedSchedules);