new Calendar(nameOrId, icsProvider, icsIntervalMsecs, enabled)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
nameOrId |
String | a name or ID for this calendar (should be unique across all calendars). | |
icsProvider |
producerHandler.<(String|Promise.<String>)> | a function that returns the underlying iCal data as string. | |
icsIntervalMsecs |
number | 10000 | the interval in milliseconds, to refresh this calendar and reload the iCal-data from the provider. It is not recommended to refresh a calendar more often than every 10 seconds. Of course, this depends on where your calendar is coming from. If the interval is less than 5 seconds, the constructor throws. |
enabled |
boolean | true | if true, this Interval is enabled. Otherwise, its events are ignored until it get enabled. |
- Source:
Members
events
- Source:
expander
- Source:
needsRefresh
- Source:
Methods
createFiltered(predicate, addName) → {Calendar}
Takes a predicate to filter this Calendar's events and returns a
new, derived Calendar. Calls to refresh() have been overridden in
the derived instance to await the underlying Calendar's refresh
and apply the filter afterwards.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
predicate |
predicate1Arg.<(Event|iCalEvent)> | Used to filter this Calendar's events using some criteria. | |
addName |
string | filtered | Used as a predicate to this Calendar's name or ID so that we end up with a new, unique name or ID. Must not be empty. The resulting name will be "calendar-name.addName". |
- Deprecated:
- use setFilter() and removeFilter() instead. This method will be removed in v3.x!
- Source:
Returns:
- Type
- Calendar
(generator) preliminaryEvents(afteropt, beforeopt) → {IterableIterator.<PreliminaryScheduleEvent.<Calendar, iCalTime>>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
after |
Date |
<optional> |
|
before |
Date |
<optional> |
- Source:
Returns:
- Type
- IterableIterator.<PreliminaryScheduleEvent.<Calendar, iCalTime>>
(async) refresh() → {Promise.<this>}
Called by the CalendarScheduler to query this Calendar's underlying
ICS-provider. This method is useful if the ICS-provider e.g. points
to web-based calendar.
- Source:
Returns:
- Type
- Promise.<this>
removeFilter() → {this}
Removes a filter that was set by setFilter(). This Calendar then will
work with all its events again.
- Source:
Returns:
- Type
- this
setFilter(filter) → {this}
Apply a filter to this Calendar's events. The filter must return true
if an entry shall be kept; false, otherwise.
Parameters:
Name | Type | Description |
---|---|---|
filter |
predicate1Arg.<(Event|iCalEvent)> |
- Source:
Returns:
- Type
- this