diff --git a/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java b/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java index f4b2bb3..c3292f6 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java @@ -20,6 +20,7 @@ public class GardenSchedule { * Comparators to create sorted Task List */ static final Comparator sortByStartDate = Comparator.comparing(Task::getStartDate); + static final Comparator sortByNextExecution = Comparator.comparing(Task::getNextExecution); /** * Constructor to create Database Objects. @@ -176,7 +177,7 @@ public class GardenSchedule { * @throws IOException If the database cannot be accessed */ public List getFilteredTaskList(LocalDate start, LocalDate end) throws IOException { - return getSortedTaskList(taskList.getTaskList(start, end), sortByStartDate); + return getSortedTaskList(taskList.getTaskList(start, end), sortByNextExecution); } /**