Skip to content

Instantly share code, notes, and snippets.

@kewisch
Forked from lightsofapollo/ical_buider.js
Created September 18, 2012 17:00
Show Gist options
  • Save kewisch/3744313 to your computer and use it in GitHub Desktop.
Save kewisch/3744313 to your computer and use it in GitHub Desktop.
// Post parser
// COMPONENT OR STRING
//SAX?
var builder = ICAL.Builder({ /* options */ });
builder.onitem = function() {
};
builder.onexception = function() {
// we might need this kind of function, so the code knows when the item has been modified.
// If not set, then either onitem could be fired more than once, maybe configurable in the options.
}
builder.oncomplete = function() {
};
builder.process(vcalendar);
// NEXT ?
while((item = builder.next())) {
if (item instanceof ICAL.Event) {
if (item.isRecurring) {
// do stuff
item.exceptions;
// start/end window, count
items.nextOccurences(new Date(2011, 1, 1), new Date(2012, 1, 5), 10);
}
}
}
// Some event
var component;
var event = new ICAL.Event(component);
// I'd say event.startDate, as DTSTART is very "technical"
event.DTSTART?
event.start?
event.endDate?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment