Class RecurrenceEvaluator
java.lang.Object
org.vaadin.addons.componentfactory.schedulexcalendar.util.RecurrenceEvaluator
Utility class to evaluate recurrence rules against a date range.
This evaluator checks whether at least one occurrence of a recurring event
defined by a RecurrenceRule falls within a given date range.
Supported rule parts:
FREQ=DAILY|WEEKLY|MONTHLY|YEARLYINTERVAL=nCOUNT=nUNTIL=YYYYMMDD or YYYYMMDDTHHMMSSBYDAY=MO,TU,...(for WEEKLY)BYMONTHDAY=1,15,...(for MONTHLY)
This evaluator does not generate all occurrences. It stops early once it detects that an occurrence falls within the provided date range.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanoccursInRange(RecurrenceRule rule, LocalDate startDate, LocalDate rangeStart, LocalDate rangeEnd) Checks whether a recurring event described byruleand starting onstartDatehas at least one occurrence betweenrangeStartandrangeEnd.
-
Constructor Details
-
RecurrenceEvaluator
public RecurrenceEvaluator()
-
-
Method Details
-
occursInRange
public static boolean occursInRange(RecurrenceRule rule, LocalDate startDate, LocalDate rangeStart, LocalDate rangeEnd) Checks whether a recurring event described byruleand starting onstartDatehas at least one occurrence betweenrangeStartandrangeEnd.- Parameters:
rule- the recurrence rulestartDate- the start date of the first occurrencerangeStart- the inclusive start of the range to checkrangeEnd- the exclusive end of the range to check- Returns:
- true if at least one recurrence falls in the range, false otherwise
-