Constructor
new Recur(data)
Create a new instance of the Recur class.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | Object | An object with members of the recurrence Properties
|
Members
(nullable) count :Number
The maximum number of occurrences
- Number
freq :ICAL.Recur.frequencyValues
The frequency value.
(constant) icalclass :String
The class identifier.
- String
- Default Value
- "icalrecur"
(constant) icaltype :String
The type name, to be used in the jCal object.
- String
- Default Value
- "recur"
interval :Number
The interval value for the recurrence rule.
- Number
parts :ICAL.Recur.byParts
An object holding the BY-parts of the recurrence rule
(nullable) until :ICAL.Time
The end of the recurrence
wkst :ICAL.Time.weekDay
The week start day
- Default Value
- ICAL.Time.MONDAY
Methods
addComponent(aType, aValue)
Adds a component (part) to the recurrence rule. This is not a component in the sense of ICAL.Component, but a part of the recurrence rule, i.e. BYMONTH.
Name | Type | Description |
---|---|---|
aType | String | The name of the component part |
aValue | Array | | The component value |
clone() → {ICAL.Recur}
Returns a clone of the recurrence object.
The cloned object
- Type:
- ICAL.
Recur
fromData(data)
Sets up the current instance using members from the passed data object.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | Object | An object with members of the recurrence Properties
|
getComponent(aType) → {Array}
Gets (a copy) of the requested component value.
Name | Type | Description |
---|---|---|
aType | String | The component part name |
The component part value
- Type:
- Array
getNextOccurrence(aStartTime, aRecurrenceId) → {ICAL.Time}
Retrieves the next occurrence after the given recurrence id. See the guide on terminology for more details.
NOTE: Currently, this method iterates all occurrences from the start date. It should not be called in a loop for performance reasons. If you would like to get more than one occurrence, you can iterate the occurrences manually, see the example on the iterator method.
Name | Type | Description |
---|---|---|
aStartTime | ICAL. | The start of the event series |
aRecurrenceId | ICAL. | The date of the last occurrence |
The next occurrence after
- Type:
- ICAL.
Time
isByCount() → {Boolean}
Checks if the current rule has a count part, and not limited by an until part.
True, if the rule is by count
- Type:
- Boolean
isFinite() → {Boolean}
Checks if the current rule is finite, i.e. has a count or until part.
True, if the rule is finite
- Type:
- Boolean
iterator(aStart) → {ICAL.RecurIterator}
Create a new iterator for this recurrence rule. The passed start date must be the start date of the event, not the start of the range to search in.
Name | Type | Description |
---|---|---|
aStart | ICAL. | The item's start date |
The recurrence iterator
- Type:
- ICAL.
RecurIterator
let recur = comp.getFirstPropertyValue('rrule');
let dtstart = comp.getFirstPropertyValue('dtstart');
let iter = recur.iterator(dtstart);
for (let next = iter.next(); next; next = iter.next()) {
if (next.compare(rangeStart) < 0) {
continue;
}
console.log(next.toString());
}
setComponent(aType, aValues)
Sets the component value for the given by-part.
Name | Type | Description |
---|---|---|
aType | String | The component part name |
aValues | Array | The component values |
toJSON() → {Object}
The jCal representation of this recurrence type.
- Type:
- Object
toString() → {String}
The string representation of this recurrence rule.
- Type:
- String
(static) fromData(aData)
Creates a new ICAL.Recur instance using members from the passed data object.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aData | Object | An object with members of the recurrence Properties
|
(static) fromString(string) → {ICAL.Recur}
Creates a new ICAL.Recur instance from the passed string.
Name | Type | Description |
---|---|---|
string | String | The string to parse |
The created recurrence instance
- Type:
- ICAL.
Recur
(static) icalDayToNumericDay(string, aWeekStartopt) → {Number}
Convert an ical representation of a day (SU, MO, etc..) into a numeric value of that day.
Name | Type | Attributes | Description |
---|---|---|---|
string | String | The iCalendar day name | |
aWeekStart | ICAL. | <optional> | The week start weekday, defaults to SUNDAY |
Numeric value of given day
- Type:
- Number
(static) numericDayToIcalDay(num, aWeekStartopt) → {String}
Convert a numeric day value into its ical representation (SU, MO, etc..)
Name | Type | Attributes | Description |
---|---|---|---|
num | Number | Numeric value of given day | |
aWeekStart | ICAL. | <optional> | The week start weekday, defaults to SUNDAY |
The ICAL day value, e.g SU,MO,...
- Type:
- String
Type Definitions
byParts
An object holding the BY-parts of the recurrence rule
- Object
Name | Type | Attributes | Description |
---|---|---|---|
BYSECOND | Array.<Number> | <optional> | The seconds for the BYSECOND part |
BYMINUTE | Array.<Number> | <optional> | The minutes for the BYMINUTE part |
BYHOUR | Array.<Number> | <optional> | The hours for the BYHOUR part |
BYDAY | Array.<String> | <optional> | The BYDAY values |
BYMONTHDAY | Array.<Number> | <optional> | The days for the BYMONTHDAY part |
BYYEARDAY | Array.<Number> | <optional> | The days for the BYYEARDAY part |
BYWEEKNO | Array.<Number> | <optional> | The weeks for the BYWEEKNO part |
BYMONTH | Array.<Number> | <optional> | The month for the BYMONTH part |
BYSETPOS | Array.<Number> | <optional> | The positionals for the BYSETPOS part |
frequencyValues
Possible frequency values for the FREQ part (YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY)
- String