diff options
Diffstat (limited to 'src/main/java/org/traccar/model/Calendar.java')
-rw-r--r-- | src/main/java/org/traccar/model/Calendar.java | 5 |
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()); } |