events-series
Uses logic from rrule to handle logic for updating recurring events.
You have a bunch of events generated from a particular recurrence. But then you change the recurrence -- what do you do? events-series handles this logic for you.
Sample usage
;;; // Initialization with a list of events. Times are in UTC.const events = start: end: start: end: ;const series = events options; // Set recurrence for event (as an RRule string). If using timezones, tzid should be specified, and dtstart and until should be in the local timezone (in this case, America/Los_Angeles).const rrule = freq: RRuleDAILY interval: 1 dtstart: until: tzid: "America/Los_Angeles";series;// Get all current events in the series:series// Get all events created by the previous operation:series// Get all events deleted by the previous operation:series // Set length of all events to a particular duration, keeping the start times constant (and only varying the end time).series;// Get all events updated by the previous operation:series // Split the series into two (includes events that start at the current time).const past future = series;// Set all future events' length to 1 hour.future;
Options config
const options = {
maxRepeats: 100, // Maximum number of repeats generated when applying an rrule to a series.
length: 10000, // Length in milliseconds of new dates to be added. If not specified, defaults to the length of the first event, or 0.
}