aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/model
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-04-20 09:36:05 -0700
committerAnton Tananaev <anton@traccar.org>2024-04-20 09:36:05 -0700
commit8e4e92f84f149ec9f9da6dd601fab06ed55c544c (patch)
tree557ecc159ff7261f24cf50d030ce7cbc1f9701ac /src/main/java/org/traccar/model
parent7b3fda2da562ce7b259a232bf9fc5f519c138283 (diff)
downloadtrackermap-server-8e4e92f84f149ec9f9da6dd601fab06ed55c544c.tar.gz
trackermap-server-8e4e92f84f149ec9f9da6dd601fab06ed55c544c.tar.bz2
trackermap-server-8e4e92f84f149ec9f9da6dd601fab06ed55c544c.zip
Improve report schedules logic
Diffstat (limited to 'src/main/java/org/traccar/model')
-rw-r--r--src/main/java/org/traccar/model/Calendar.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/model/Calendar.java b/src/main/java/org/traccar/model/Calendar.java
index feef7286f..76c9a2cc1 100644
--- a/src/main/java/org/traccar/model/Calendar.java
+++ b/src/main/java/org/traccar/model/Calendar.java
@@ -34,6 +34,7 @@ import java.time.Duration;
import java.util.Collection;
import java.util.Date;
import java.util.List;
+import java.util.Set;
import java.util.stream.Collectors;
@StorageName("tc_calendars")
@@ -78,7 +79,7 @@ public class Calendar extends ExtendedModel {
}
}
- public Collection<Period> findPeriods(Date date) {
+ public Set<Period> findPeriods(Date date) {
return findEvents(date).stream()
.flatMap((e) -> e.calculateRecurrenceSet(new Period(new DateTime(date), Duration.ZERO)).stream())
.collect(Collectors.toSet());