Skip to content

Doesn't support RECURRENCE-ID or EXDATE #63

@mbalfour

Description

@mbalfour

The basic RRULE command is implemented, but not the companion RECURRENCE-ID or EXDATE commands:
https://nylas.com/blog/rrules/

If you have an ics file that looks like this:
BEGIN:VEVENT
UID:0000001
RRULE:FREQ=DAILY;COUNT=5
SUMMARY:Treasure Hunting
DTSTART;TZID=America/Los_Angeles:20150706T120000
DTEND;TZID=America/Los_Angeles:20150706T130000
END:VEVENT

BEGIN:VEVENT
UID:0000001
SUMMARY:Treasure Hunting
LOCATION:The other island
DTSTART;TZID=America/Los_Angeles:20150707T120000
DTEND;TZID=America/Los_Angeles:20150707T130000
RECURRENCE-ID;TZID=America/Los_Angeles:20150707T120000
END:VEVENT

Right now, ical.js will silently replace the recurring event with the single instance. This happens where the code does this:
if (curr.uid)
par[curr.uid] = curr

This should probably look something more like this:
if (curr.uid)
{
if (par[curr.uid] === undefined)
{
par[curr.uid] = curr
}
else
{
// TODO: Add support for RECURRENCE-ID
}
}

Neither the old behaviour or this one is correct, but if you added error-handling code at the TODO area, you could warn users when the calendar is being parsed incorrectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions