aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/model
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-04-20 09:28:20 -0700
committerAnton Tananaev <anton@traccar.org>2024-04-20 09:28:20 -0700
commit7b3fda2da562ce7b259a232bf9fc5f519c138283 (patch)
treecb83e41b95e318e5236cf66676dfa3a613805395 /src/main/java/org/traccar/model
parent0a5683733c7b01a0af07cee7a4340c45e19b6ceb (diff)
downloadtrackermap-server-7b3fda2da562ce7b259a232bf9fc5f519c138283.tar.gz
trackermap-server-7b3fda2da562ce7b259a232bf9fc5f519c138283.tar.bz2
trackermap-server-7b3fda2da562ce7b259a232bf9fc5f519c138283.zip
Fix overlapping report schedules
Diffstat (limited to 'src/main/java/org/traccar/model')
-rw-r--r--src/main/java/org/traccar/model/Calendar.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/model/Calendar.java b/src/main/java/org/traccar/model/Calendar.java
index 03f1995ba..feef7286f 100644
--- a/src/main/java/org/traccar/model/Calendar.java
+++ b/src/main/java/org/traccar/model/Calendar.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 - 2022 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2024 Anton Tananaev (anton@traccar.org)
* Copyright 2016 Andrey Kunitsyn (andrey@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -79,9 +79,8 @@ public class Calendar extends ExtendedModel {
}
public Collection<Period> findPeriods(Date date) {
- var calendarDate = new net.fortuna.ical4j.model.Date(date);
return findEvents(date).stream()
- .flatMap((event) -> event.getConsumedTime(calendarDate, calendarDate).stream())
+ .flatMap((e) -> e.calculateRecurrenceSet(new Period(new DateTime(date), Duration.ZERO)).stream())
.collect(Collectors.toSet());
}