icalevent icon indicating copy to clipboard operation
icalevent copied to clipboard

provide a way to create more than one event in a calendar file

Open regular opened this issue 13 years ago • 8 comments

would be very useful!

regular avatar Jan 31 '13 21:01 regular

Can you provide what the resulting file would look like? I've never seen a multi event file before.

shanebo avatar Jan 31 '13 21:01 shanebo

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

regular avatar Mar 15 '13 11:03 regular

Would be realy nice! you can look here: http://stackoverflow.com/questions/1823647/grouping-multiple-events-in-a-single-ics-file-icalendar-stream

mat1990dj avatar Aug 13 '13 08:08 mat1990dj

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)

ryanhestin avatar Dec 09 '13 04:12 ryanhestin

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?

shanebo avatar Dec 09 '13 20:12 shanebo

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
    }
]);

SamVerschueren avatar Aug 01 '14 06:08 SamVerschueren

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.

shanebo avatar Aug 05 '14 17:08 shanebo

I think this is fixed by @sourcehunter in https://github.com/shanebo/icalevent/pull/7.

wearhere avatar Feb 08 '16 05:02 wearhere