-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
bug: dates without time #61
Comments
Wow, thanks for reporting this! It is true, that the calendar time zone is not used for the events.... I wonder though, where to put the responsibility as the parser icalendar might really not be the right place for inheriting time zones from the calendar to the event. Maybe in the mean time, it would be good to have references from the standard. |
I had a look at the ICS file. There is no reason that I can see why there should be a time zone in the ICS event. Looking at your code, I think that maybe, you would like to use a |
By the way: There is a mistake: Here, a ':' is expected, not a ';'
|
Okay, it seems that the So, what you can do to have events with a time zone, is that you go though the calendar yourself and modify the events based on the But it is right: as pointed out in #63, you should still be allowed to pass the argument, I would assume. |
A fix is deployed from version v0.2.3b on. |
Nicco, thanks for looking into this and fixing the crash. I'll try the updated version and take a look at #53. |
I opened #71 to discuss X-WR-TIMEZONE because you are not the only one facing this. |
Describe the bug
First, thanks for this library. It is very helpful.
Our group uses Confluence calendars which allows the scheduling of an All Day event. When these are read by the library, they become datetime.date instead of datetime.datetime and they have no timezone. As a result, the assert on line 52 (assert tzinfo is not None..) is hit. The reason tzinfo is never set is because there are no datetime's found in the calendar.
To Reproduce
import datetime
from pytz import timezone
import recurring_ical_events
calendar = Calendar.from_ical(ics_file) # ics_file is the attached ics file
tz = str(calendar.get('X-WR-TIMEZONE'))
now = datetime.datetime.now(timezone(tz)
recurring_ical_events.of(calendar).at(now)
ICS file
Expected behavior
if the default tzinfo from the calendar, the code works as-is.
Console output
none
Version:
latest
Additional context
none
Suggested implementation
My thought for a fix would be to initialize tzinfo with the timezone from the calendar. It exists in the Confluence calendar file, but I don't know if that's a standard field.
The text was updated successfully, but these errors were encountered: