java.lang.Object
org.vaadin.addons.componentfactory.schedulexcalendar.util.RecurrenceEvaluator

public class RecurrenceEvaluator extends Object
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|YEARLY
  • INTERVAL=n
  • COUNT=n
  • UNTIL=YYYYMMDD or YYYYMMDDTHHMMSS
  • BYDAY=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 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 by rule and starting on startDate has at least one occurrence between rangeStart and rangeEnd.
      Parameters:
      rule - the recurrence rule
      startDate - the start date of the first occurrence
      rangeStart - the inclusive start of the range to check
      rangeEnd - the exclusive end of the range to check
      Returns:
      true if at least one recurrence falls in the range, false otherwise