jspricke / python-remind

Python library to convert between Remind and iCalendar
GNU General Public License v3.0
13 stars 6 forks source link

Problem with date rollover for timezone adjustment in ics2rem #8

Open Xitian9 opened 7 years ago

Xitian9 commented 7 years ago

When using the ics2rem program, if an event falls on a different date in local time than it does in the original timezone, this different date will not be reflected.

For example, if an event occurs on 26 February at 14:58 UTC, then in a timezone at UTC+11, this would fall on 27 February at 01:58 local time. However, ics2rem will report that the event falls on 26 February at 01:58 local time.

jspricke commented 7 years ago

Good point, I guess we have to adopt https://github.com/jspricke/python-remind/blob/master/remind.py#L372 the same way as https://github.com/jspricke/python-remind/blob/master/remind.py#L398. Looking through it, do we need it for all other date strings (tend, rrule) as well? Maybe extract it into an extra function? Would you be willing to test such a patch (or do you want to implement it)?

Xitian9 commented 7 years ago

I've implemented a quick fix for the dtstart and dtend properties, but looking at rrule, this might be a bit trickier. A solution would need to take care of transforming weekday recurrence as well.

Xitian9 commented 7 years ago

In fact, timezone transformation for recurring events seems like a difficult problem in general. For example, how do we deal with the following case?

Location A has a recurring event every Monday at 15:00. Location B is one hour ahead of Location A, but in addition follows a different schedule for daylight savings time than Location A. We would then need (at least) two different remind entries which apply at different times of the year corresponding to different time offsets.

This seems like a problem which should really be handled by remind itself. Maybe there's some user function we could include at the beginning of every generated remind file that does this, but I'm not sure if remind's timezone handling is good enough for this.

jspricke commented 7 years ago

Thanks a lot for the partial fix! I will leave this open for now.