ICAL. ComponentParser

The ComponentParser is used to process a String or jCal Object, firing callbacks for various found components, as well as completion.

Constructor

new ComponentParser(optionsopt)

Creates a new ICAL.ComponentParser instance.

Parameters:
NameTypeAttributesDescription
optionsObject<optional>

Component parser options

Properties
NameTypeDescription
parseEventBoolean

Whether events should be parsed

parseTimezeoneBoolean

Whether timezones should be parsed

Example
var options = {
  // when false no events will be emitted for type
  parseEvent: true,
  parseTimezone: true
};

var parser = new ICAL.ComponentParser(options);

parser.onevent(eventComponent) {
  //...
}

// ontimezone, etc...

parser.oncomplete = function() {

};

parser.process(stringOrComponent);

Members

parseEvent :Boolean

When true, parse events

Type:
  • Boolean

parseTimezone :Boolean

When true, parse timezones

Type:
  • Boolean

Methods

process(ical)

Process a string or parse ical object. This function itself will return nothing but will start the parsing process.

Events must be registered prior to calling this method.

Parameters:
NameTypeDescription
icalICAL.Component | String | Object

The component to process, either in its final form, as a jCal Object, or string representation

Type Definitions

oncomplete

Fired when parsing is complete

onerror

Fired if an error occurs during parsing.

onevent

Fired when a top level component (VEVENT) is found.

ontimezone

Fired when a top level component (VTIMEZONE) is found