mifi / ical-expander

ICS / iCal / iCalendar parser / expander
MIT License
64 stars 21 forks source link

"between" for modified recurring events doesn't work as expected #14

Closed andeee closed 4 years ago

andeee commented 4 years ago

Hi Mikael,

in the test ics file icaljs-issue-285.ics there is a recurring event, where one occurence is modified not to be on 17.01.2017 but on 18.01.2017. using your library

new IcalExpander({ ics: icaljsIssue285 })
    .between(new Date('2017-01-18T00:00:00.000Z'), new Date('2017-01-19T00:00:00.000Z'))

returns neither a occurence nor an event - I would expect the library to return the modified recurrence here.

I have prepared 2 branches on my fork, each one should fix the issue - but I would like to discuss the changes and options with you first.

I'm looking forward to your reply!

mifi commented 4 years ago

Hey, I'm sorry for the slow reply, I forgot about this one. I think upgrading to 1.3.0 is the right way to go. I haven't used ical-expander in a while, so I don't remember the details now, but if you agree that option 2 is the right way, then i'm happy to merge a PR for that fix.

radarfox commented 4 years ago

Hello,

I'm confirming this problem. ical-expander in versions 2.0 and 2.1 doesn't work with modified occurrences of recurring events. It simply ignores them.

I have used the second option suggested by @andeee and everything works just fine. I have enforced a new version in package.json, like this:

{
  "resolutions": {
    "ical.js": "^1.4.0"
  }
}

Both 1.3 and 1.4 of ical.js works fine.

Can you please fix this, as it should be super easy, and @andeee even prepared the unit tests for it.

andeee commented 4 years ago

@mifi - Hi, no problem - I just created a pull request for option 2.