Kaizen
Browse modulesBookingsbookings/sharedFunctions

Function: capSeriesRuleBefore()

function capSeriesRuleBefore(template: SeriesTemplate, splitInstant: Date): CapSeriesRuleResult;

Defined in: shared/bookings/series-template.ts:196

THE one rule-capping implementation (spec §6.8 "this and following"): cap template.recurrenceRule so its last occurrence falls strictly BEFORE splitInstant.

  • COUNT rule → lower COUNT to the number of occurrences before the split (never COUNT+UNTIL, RFC-illegal). Needs the template's DTSTART to count occurrences.
  • UNTIL / unbounded rule → cap with UNTIL = splitInstant − 1s (UNTIL is inclusive).

Parameters

ParameterType
templateSeriesTemplate
splitInstantDate

Returns

CapSeriesRuleResult

On this page