Constructor
new Component(jCal, parentopt)
Creates a new Component instance.
| Name | Type | Attributes | Description | 
|---|---|---|---|
jCal | Array | | Raw jCal component data OR name of new component  | |
parent | ICAL. | <optional> | Parent component to associate  | 
- Source
 
Members
name :String
The name of this component
- String
 
- Source
 
Methods
addProperty(property) → {ICAL.Property}
Adds an ICAL.Property to the component.
| Name | Type | Description | 
|---|---|---|
property | ICAL. | The property to add  | 
- Source
 
The passed in property
- Type:
 - ICAL.
Property  
addPropertyWithValue(name, value) → {ICAL.Property}
Helper method to add a property with a value to the component.
| Name | Type | Description | 
|---|---|---|
name | String | Property name to add  | 
value | String | | Property value  | 
- Source
 
The created property
- Type:
 - ICAL.
Property  
addSubcomponent(component) → {ICAL.Component}
Adds a single sub component.
| Name | Type | Description | 
|---|---|---|
component | ICAL. | The component to add  | 
- Source
 
The passed in component
- Type:
 - ICAL.
Component  
getAllProperties(nameopt) → {Array.<Property>}
Get all properties in the component, optionally filtered by name.
| Name | Type | Attributes | Description | 
|---|---|---|---|
name | String | <optional> | Lowercase property name  | 
- Source
 
List of properties
- Type:
 - Array.<Property>
 
getAllSubcomponents(nameopt) → {Array.<Component>}
Finds all sub components, optionally filtering by name.
| Name | Type | Attributes | Description | 
|---|---|---|---|
name | String | <optional> | Optional name to filter by  | 
- Source
 
The found sub components
- Type:
 - Array.<Component>
 
getFirstProperty(nameopt) → (nullable) {ICAL.Property}
Finds the first property, optionally with the given name.
| Name | Type | Attributes | Description | 
|---|---|---|---|
name | String | <optional> | Lowercase property name  | 
- Source
 
The found property
- Type:
 - ICAL.
Property  
getFirstPropertyValue(nameopt) → {ICAL.Binary|ICAL.Duration|ICAL.Period|ICAL.Recur|ICAL.Time|ICAL.UtcOffset|Geo|string|null}
Returns first property's value, if available.
| Name | Type | Attributes | Description | 
|---|---|---|---|
name | String | <optional> | Lowercase property name  | 
- Source
 
The found property value.
- Type:
 - ICAL.
Binary |ICAL. Duration |ICAL. Period |ICAL. Recur |ICAL. Time |ICAL. UtcOffset |Geo | string | null  
getFirstSubcomponent(nameopt) → (nullable) {ICAL.Component}
Finds first sub component, optionally filtered by name.
| Name | Type | Attributes | Description | 
|---|---|---|---|
name | String | <optional> | Optional name to filter by  | 
- Source
 
The found subcomponent
- Type:
 - ICAL.
Component  
getTimeZoneByID(tzid) → {ICAL.Timezone}
Retrieve a time zone definition from the component tree, if any is present. If the tree contains no time zone definitions or the TZID cannot be matched, returns null.
| Name | Type | Description | 
|---|---|---|
tzid | String | The ID of the time zone to retrieve  | 
- Source
 
The time zone corresponding to the ID, or null
- Type:
 - ICAL.
Timezone  
hasProperty(name) → {Boolean}
Returns true when a named property exists.
| Name | Type | Description | 
|---|---|---|
name | String | The property name  | 
- Source
 
True, when property is found
- Type:
 - Boolean
 
removeAllProperties(nameopt) → {Boolean}
Removes all properties associated with this component, optionally filtered by name.
| Name | Type | Attributes | Description | 
|---|---|---|---|
name | String | <optional> | Lowercase property name  | 
- Source
 
True, when deleted
- Type:
 - Boolean
 
removeAllSubcomponents(nameopt)
Removes all components or (if given) all components by a particular name.
| Name | Type | Attributes | Description | 
|---|---|---|---|
name | String | <optional> | Lowercase component name  | 
- Source
 
removeProperty(nameOrProp) → {Boolean}
Removes a single property by name or the instance of the specific property.
| Name | Type | Description | 
|---|---|---|
nameOrProp | String | | Property name or instance to remove  | 
- Source
 
True, when deleted
- Type:
 - Boolean
 
removeSubcomponent(nameOrComp) → {Boolean}
Removes a single component by name or the instance of a specific component.
| Name | Type | Description | 
|---|---|---|
nameOrComp | ICAL. | Name of component, or component  | 
- Source
 
True when comp is removed
- Type:
 - Boolean
 
toJSON() → {Object}
Returns the Object representation of this component. The returned object is a live jCal object and should be cloned if modified.
- Source
 
- Type:
 - Object
 
toString() → {String}
The string representation of this component.
- Source
 
- Type:
 - String
 
updatePropertyWithValue(name, value) → {ICAL.Property}
Helper method that will update or create a property of the given name and sets its value. If multiple properties with the given name exist, only the first is updated.
| Name | Type | Description | 
|---|---|---|
name | String | Property name to update  | 
value | String | | Property value  | 
- Source
 
The created property
- Type:
 - ICAL.
Property  
(static) fromString(str)
Create an ICAL.Component by parsing the passed iCalendar string.
| Name | Type | Description | 
|---|---|---|
str | String | The iCalendar string to parse  | 
- Source