niccokunzmann/python-recurring-ical-events

bug: one day event spans multi day

mrx23dot opened this issue · 7 comments

Using: Successfully installed recurring-ical-events-0.1.18b0

I have one full day event in the calendar (made with google calendar):
DTSTART;VALUE=DATE:20200814
DTEND;VALUE=DATE:20200815 -> I guess this is parsed as 8/15/0:00, technically a new day
SUMMARY:test2

When running the attached script the event is reported not only one aug.14 day.
date (2020, 8, 13)
date (2020, 8, 14)
test2
date (2020, 8, 15)
test2
date (2020, 8, 16)

Not sure what ical standard says about this, but google is a big player.
multiday.zip

@mrx23dot Thanks for reporting this, this is a nice issue and should be easily testable. I would also think that this is unexpected to see it on the following day. If you like, you can start a PR with the ICS file and also start adding a test.

Hi, I already attached ICS and test case previously, the code seems way too complicated, I don't want to break it.

I found the reason:

"For your example, DTSTART=20101220, DTEND=20101221 since the end is exclusive."
https://stackoverflow.com/questions/4434766/android-google-calendar-dtstart-dtend/4434927

So subtracting 1sec from DTEND would solve the problem.

Thanks for reporting a solution, too. As I do not have much time at the moment, I would wait for other people to step up. I regard this issue as one of the best to start contributing to this repository.

I think i found the same issue, reported here:
#60

I dont think that substracting a second is a good idea. We should rather check if it is a date object instead of datetime and then compare properly.

In #68, the error is reproduced.

This is fixed from version 0.2.2b on.