RecurringTimeSpan
Properties
8
Properties
8Class hierarchy
Recurrence
Indicates if the timespan is an occurrence of another recurring timespan.
Indicates if the timespan is recurring.
If this event is an occurrence of a recurring event, then this property yields its zero-based occurrence index in the sequence.
The recurrence model used for the timespan.
Name of the class representing the recurrence model, defaults to RecurrenceModel
Returns true if this timespan supports recurring.
Functions
5
Functions
5Adds an exception date that should be skipped when generating occurrences for the timespan. The method adds an entry to the array kept in exceptionDates field.
| Parameter | Type | Description |
|---|---|---|
date | Date | Exception date |
Returns the occurrences of this event over the specified time range. If the first
occurrence is in the time range *this* record is included in that position.
| Parameter | Type | Description |
|---|---|---|
startDate | Date | The start date of the range for which to include occurrences. |
endDate | Date | The end date of the range for which to include occurrences. Defaults to the startDate. |
The array of occurrences which occur over the specified range.
Does this recurring event have an exception on the passed date.
| Parameter | Type | Description |
|---|---|---|
date | Date | The date to find an exception for. |
true if the event has an exception starting on the passed date.
Override of Model's method. If an isOccurrence is passed, it is detached from its parent recurring event. If it still has a recurrence then the recurring event is changed to stop at the occurrence date. If it has no recurrence an exception is added at the occurrence date.
Sets a recurrence for the timespan with a given frequency, interval, and end.
| Parameter | Type | Description |
|---|---|---|
recurrence | RecurrenceModelConfig | String | RecurrenceModel | A data object for an instance of
RecurrenceModel. May also be the frequency string:
Also a recurrence model can be provided as the only argument for this method:
or |
interval | Number | The interval between occurrences (instances of this recurrence). For example, a daily recurrence with an interval of 2 occurs every other day. Must be greater than 0. |
recurrenceEnd | Number | Date | The end of the recurrence. The value can be specified by a date or by a maximum count of occurrences (has to greater than 1, since 1 means the event itself). |
Fields
2
Fields
2A string (either a single date or multiple dates separated by comma) or an array of strings containing the timespan exception dates. The dates that must be skipped when generating occurrences for a repeating timespan. This is used to modify only individual occurrences of the timespan so the further regenerations won't create another copy of this occurrence again.
{
id: 7,
startDate: '2021-10-12T14:00:00',
endDate: '2021-10-12T15:00:00',
name: 'Lunch',
resourceId: 'hotel',
recurrenceRule: 'FREQ=DAILY;COUNT=5',
exceptionDates: ['2021-10-14']
}
Use addExceptionDate method to add an individual entry to the dates array:
// Break the link between the occurrence and its base.
// This also adds the occurrence date as an exception date
// so that the base timespan knows that this date should be skipped when regenerating its occurrences.
occurrence.recurringTimeSpan = null;
// now the occurrence is an individual record that can be changed & persisted freely
occurrence.setStartEndDate(new Date(2018, 6, 2), new Date(2018, 6, 3));
Note: The dates in this field get automatically removed when the event changes its start date.
The timespan recurrence rule. A string in RFC-5545 described format ("RRULE" expression).