Skip to content

Instantly share code, notes, and snippets.

@lightsofapollo
Created September 18, 2012 16:46
Show Gist options
  • Save lightsofapollo/3744221 to your computer and use it in GitHub Desktop.
Save lightsofapollo/3744221 to your computer and use it in GitHub Desktop.
// Post parser
// COMPONENT OR STRING
//SAX?
var builder = ICAL.Builder({ /* options */ });
builder.onitem = function() {
};
builder.oncomlete = 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.nextOccurances(new Date(2011, 1, 1), new Date(2012, 1, 5), 10);
}
}
}
// Some event
var component;
var event = new ICAL.Event(component);
event.DTSTART?
event.start?
event.endDate?
@lightsofapollo
Copy link
Author

builder.next will only return full events (not exceptions). The api may not be obvious here but I don't think we should block the whole iteration if we don't have all the exceptions. After the loop all the exceptions should be present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment