Module Betacalendars.Recurrence

type invalid_day_policy =
  1. | Skip
  2. | Clamp_to_last_day
  3. | Error

Bounded synchronous recurrence expansion; this is not full RFC 5545.

type rule =
  1. | Every_n_days of int
  2. | Weekly of Weekday.t list
  3. | Monthly_day of {
    1. day : int;
    2. policy : invalid_day_policy;
    }
  4. | Nth_weekday of {
    1. ordinal : int;
    2. weekday : Weekday.t;
    }
  5. | Last_weekday of Weekday.t
  6. | Annual_date of {
    1. month : int;
    2. day : int;
    3. policy : invalid_day_policy;
    }

A bounded recurrence rule with an explicit invalid-day policy.

val expand : rule -> within:Date_range.t -> (Civil_date.t list, [ `Invalid_rule ]) Stdlib.result

Expand only inside the required finite inclusive range.