ics-generator
generate .ics files compliant to selected portions of iCalendar specifications.
This package is mostly geared towards disseminating updates about events and synchronizing calendars for various clients. Feel free to fork and customize to your needs.
For a complete list of RFC-specified properties, see RFC 5545.
Usage
Include package
meteor add stuke:ics-generator
Instantiate and manipulate iCal components. Use setters or construct with prepopulated options. See source code for complete list of supported properties.
var calOptions = {
prodId: "//Sugar Mills//Cereal Production",
method: "REQUEST",
events: [
{
uid: "6xB7a4M75fogA3kzd@sugarmills.com",
summary: "Favorite Cereal Discussion, Part 28",
dtStart: new Date(2015, 9, 1, 11),
dtEnd: new Date(2015, 9, 1, 12),
organizer: {cn: "Lucky Leprachaun", mailTo: "lucky@sugarmills.com"},
attendees: [
{cn: "Tony Tiger", mailTo: "tony@sugarmills.com", partStat: "NEEDS-ACTION"}
]
}
]
};
var cal = new IcsGenerator(calOptions);
var newEvent = cal.createEvent({
uid: "32eBCNdmBaCerDi7N@sugarmills.com",
summary: "Favorite Cereal Discussion, Part 29",
dtStart: new Date(2015, 9, 1, 16),
dtEnd: new Date(2015, 9, 1, 17),
organizer: {cn: "Lucky Leprachaun", mailTo: "lucky@sugarmills.com"}
});
newEvent.setProperty("attendees", [
{cn: "Tony Tiger", mailTo: "tony@sugarmills.com", partStat: "NEEDS-ACTION"},
{cn: "Toucan Sam", mailTo: "toucan@sugarmills.com", partStat: "ACCEPTED"}
]);
cal.addEvent(newEvent);
var out = cal.toIcsString();
apache license applies.