provide a way to create more than one event in a calendar file
would be very useful!
Can you provide what the resulting file would look like? I've never seen a multi event file before.
You can create a google calendar, set some events in it and download the calanders URL using curl. That's pretty nice for experimenting.
For example, try this:
curl https://www.google.com/calendar/ical/mr2aer3jbpqphnar6a7gfm3tqs%40group.calendar.google.com/public/basic.ics
Would be realy nice! you can look here: http://stackoverflow.com/questions/1823647/grouping-multiple-events-in-a-single-ics-file-icalendar-stream
I was looking for this exact same thing, all it seems like you have to do is start a new VEVENT section and it will recognize multiple events. To get a better understanding of how the file is formatted, you can go to iCal in OSX and export a calendar, then open up the ics file in a text editor. I'm currently in the middle of finals right now, but I will be working on a multi-event iteration of this code asap (within next week or two hopefully)
The string concatenation and format of the file isn't the hurdle in my mind. It's in supporting multiple events without losing a clean/focused api. What are some of the conceptual api ideas you guys have?
I would split things up in iCal and iCalEvent. Because I noticed now that it's not possible to add extra attributes like the X-WR-CALNAME etc. The only thing we can do is convert an event to a file. Something like this would be nice.
var iCal = require('ical'),
iCalEvent = iCal.Event;
var calendar = new iCal({
'X-WR-CALNAME': 'Name of the calendar',
'X-WR-TIMEZONE': 'Europe/London'
});
calendar.add(new iCalEvent({
description: 'This is the description of the event',
summary: 'The summary'
});
calendar.add(new iCalEvent({
// properties go here
});
Just giving you ideas on how the api could look like. Another possibility would be that you don't create the iCalEvent objects like that but just providing a javascript object in the calendar.add method.
var iCal = require('ical');
var calendar = new iCal({
'X-WR-CALNAME': 'Name of the calendar',
'X-WR-TIMEZONE': 'Europe/London'
});
calendar.add({
description: 'This is the description of the event',
summary: 'The summary'
});
calendar.add({
// properties go here
});
// Maybe add multiple events in one call
calendar.add([
{
description: 'This is the description of the event',
summary: 'The summary'
},
{
// Properties go here
}
]);
Great ideas Sam. Let me think on this for a while... Pretty slammed these days.
On Aug 1, 2014, at 1:41 AM, Sam Verschueren [email protected] wrote:
I would split things up in iCal and iCalEvent. Because I noticed now that it's not possible to add extra attributes like the X-WR-CALNAME etc. The only thing we can do is convert an event to a file. Something like this would be nice.
var iCal = require('ical'), iCalEvent = iCal.Event;
var calendar = new iCal({ 'X-WR-CALNAME': 'Name of the calendar', 'X-WR-TIMEZONE': 'Europe/London' });
calendar.add(new iCalEvent({ description: 'This is the description of the event', summary: 'The summary' });
calendar.add(new iCalEvent({ // properties go here }); Just giving you ideas on how the api could look like. Another possibility would be that you don't create the iCalEvent objects like that but just providing a javascript object in the calendar.add method.
var iCal = require('ical');
var calendar = new iCal({ 'X-WR-CALNAME': 'Name of the calendar', 'X-WR-TIMEZONE': 'Europe/London' });
calendar.add({ description: 'This is the description of the event', summary: 'The summary' });
calendar.add({ // properties go here });
// Maybe add multiple events in one call calendar.add([{ description: 'This is the description of the event', summary: 'The summary' }, { // Properties go here }]); — Reply to this email directly or view it on GitHub.
I think this is fixed by @sourcehunter in https://github.com/shanebo/icalevent/pull/7.