-
Notifications
You must be signed in to change notification settings - Fork 138
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
Iterator will generate events before the event starts #456
Labels
Comments
Can you please provide an (iCalendar) input, which is “interesting”? |
let component = new ICAL.Component(ICAL.parse(ical));
const vevents = component.getAllSubcomponents('vevent')
.filter((c) => !c.hasProperty('recurrence-id'))
.map((c) => new ICAL.Event(c, {'strictExceptions': true}));
// generate week starting october 5th
const start_date = Date(2020,9,5,19,0,0,0);
let iterator = vevents[0].iterator(ICAL.Time.fromJSDate(start_date)); Event (DTSTART) starts on Oct 12th, this generates one on Oct 5th |
Perhaps label this issue as a bug? |
This is still an issue and should be simple to fix. If a date is passed to iterator(), compare with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Admittedly I can also fix this in my calling code, so whether you'd like to accept it as a bug or not is entirely up to you:
https://github.com/mozilla-comm/ical.js/blob/master/lib/ical/event.js#L278-L283
This doesn't check whether the passed in startTime is before the dtstart, and happily generates events out of the original dtstart bounds, if asked to.
The text was updated successfully, but these errors were encountered: