From c9ba9c12347424f8fe2f130e16e840c7f0069685 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 25 Nov 2022 13:01:38 +0100 Subject: [PATCH] created sortByNextExecution Comparator --- .../java/ch/zhaw/gartenverwaltung/models/GardenSchedule.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } /**