Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't support RECURRENCE-ID or EXDATE #63

Open
mbalfour opened this issue Jun 26, 2016 · 1 comment
Open

Doesn't support RECURRENCE-ID or EXDATE #63

mbalfour opened this issue Jun 26, 2016 · 1 comment

Comments

@mbalfour
Copy link
Contributor

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.

mbalfour added a commit to mbalfour/ical.js that referenced this issue Jul 16, 2016
Added better support for Recurrence Rules:
- Updates to specific recurrences of events now get their own entries in
a recurrences[] array, keyed by ISO date/time.  (Previously, their
records silently overwrote the main recurrence event)
- Exceptions to recurrences now appear in an exdate[] array, keyed by
ISO date/time.

Also added "knowledge" of the dtstamp, created, and lastmodified fields
so that they get stored as dates, not strings.

This should solve issues peterbraden#57 and peterbraden#63.
@thomkrillis
Copy link

It seems this should have been resolved by #64. Can this issue be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants