niccokunzmann / python-recurring-ical-events

Python library to calculate recurrence times of events, todos and journals based on icalendar RFC5545

Home Page:https://pypi.org/project/recurring-ical-events/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: RRULE UNTIL UTC and ignored exdate

KoljaWindeler opened this issue · comments

Hi, first up: I really like your package. It works great for me in a lot of cases.
Sadly not all of them :)

The attached Zip contains 3 files.
t.ics (directly exported from calendar)
t2.ics (fixed the Timezone of the RRULE UNTIL)
test.py (test script)

running it as is (you'll have to change the path) will crash with the first error:
RRULE UNIT field is not in UTC ... the error is correct, the datetime is not in UTC, but according to my research on the web this was already fixed (seems to be OK that the until is local?)

But even with the fixed UNTIL (t2.ics) the EXDATE rule is ignored.
python3 homeassistant/test.py
start 2020-04-26 14:00:00+00:00 duration 0:30:00
start 2020-04-27 14:00:00+00:00 duration 0:30:00
start 2020-04-28 14:00:00+00:00 duration 0:30:00

is the output, but EXDATE:20200427T120000Z seems like line two shouldn't be there .. or am I understanding it wrong?

Thanks in advance!
Kolja

exdate.zip

Hi, thanks for reporting this. #25 could be related - (I remember having worked on #25).

Also, since this is reproducible, it should be easy to follow the suggested implementation path which helps keeping the other functionality intact.

Suggested implementation


At the moment, I do not have so much time. I can still help if you like to go forward changing this yourself. If you open a pull request, I will see all the changes you make and comment on them. Or you can wait for me to do it or pay me ;)

I also think, that there are several Issues we have:

  • in t1 - a conversion happens which is not done properly
  • in t2- the default time zone is not the same as the one used for the until value - adding a Z will make it UTC and as such not excluding the date. 925e966 fixes this by adding 2 hours - which might be incorrect.

@KoljaWindeler, so far, I could fix the tests in #32. However something is interesting:

Currently, the issue is that the time zone is not recognized.

These are the three dates:

start 2020-04-26 14:00:00+00:00 duration 0:30:00
start 2020-04-27 14:00:00+00:00 duration 0:30:00
start 2020-04-28 14:00:00+00:00 duration 0:30:00

But their start looks like this:
DTSTART;TZID=/freeassociation.sourceforge.net/Europe/Berlin: 20200426T140000

I think, this issue is out of scope of this repository. I think, this can be directed to the icalendar repository as I use that to parse the files.

I will close this issue now as I passed it on to the icalendar module. Please let me know if there is anything else or if that was partly a mistake.

This is solved in v0.1.18b