iCalendar parser and generator for Node.js
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples Trimmed lines from invisible spaces Mar 19, 2015
lib Merge pull request #40 from madelinecameron/master Feb 26, 2016
spec
.gitignore creating grunt and travis config Nov 20, 2013
.hgignore Added .hgignore Jan 20, 2012
.travis.yml
AUTHORS.txt Added AUTHORS file Apr 30, 2012
Gruntfile.js creating grunt and travis config Nov 20, 2013
LICENSE Put this code under the MIT license Dec 9, 2011
README.md
index.js Initial commit Dec 8, 2011
package.json

README.md

iCalendar for Node

Provides iCalendar (RFC5545) parsing as well as a convenient API for generating iCalendar data.

node-icalendar is published to npm as icalendar. To install, run:

npm install icalendar

Generating iCalendar Files

You can generate a single event:

var event = new icalendar.VEvent('cded25be-3d7a-45e2-b8fe-8d10c1f8e5a9');
event.setSummary("Test calendar event");
event.setDate(new Date(2011,11,1,17,0,0), new Date(2011,11,1,18,0,0));
event.toString();

Or create a collection of events:

var ical = new icalendar.iCalendar();
ical.addComponent(event);

var event2 = ical.addComponent('VEVENT');
event2.setSummary("Second test event");
event2.setDate(new Date(2011,11,5,12,0,0), 60*60); // Duration in seconds

Parsing iCalendar Files

Create a iCalendar collection from a string:

// data is a string containing RFC5545 data
var ical = icalendar.parse_calendar(data);

Access an array of the events defined within:

ical.events()

Implementation Status

Several portions of the iCalendar spec remain unimplemented:

* HOURLY, MINUTELY, and SECONDLY recurrence are not implemented.
    - Support for these is not currently planned, as they do not
      seem to be found in actual use.
* BYSETPOS
* WKST
    - This could very likely become important
* BYWEEKNO
* BYYEARDAY

* RDATE is not yet implemented
* RECURRENCE-ID and multiple related VEVENTS are not currently supported

* Documentation is pretty weak

Contact