jazzband / django-recurrence

Utility for working with recurring dates in Django.
https://django-recurrence.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
486 stars 190 forks source link

Issue with BYDAY recurrence and start time after midnight UTC #164

Open maxmcclorey opened 4 years ago

maxmcclorey commented 4 years ago

Suppose I have an event starting on Thursday 4/16 at 9p (2100h) Pacific time and recurring every Tuesday and Thursday. Pacific time is UTC-0700, so the event has a UTC start date of 0400h on 4/17--4am the following day.

When my recurrences are generated they take the start time of the original event, but not the date. So my recurrences are generated on Tuesdays and Thursdays at 0400h, which translates to 9p PT on Mondays and Wednesdays.

I've tried setting a timezone in the DTSTART, and am able to do that, but the issue seems to be that the BYDAY values don't take into account when the DTSTART falls after midnight UTC

havocy28 commented 3 years ago

I am also having this problem. Have you found a solution?

maxmcclorey commented 3 years ago

It turned out to be an issue with mixing timezone-aware and timezone-naive datetimes. I forget exactly what the solution was (and I'm no longer with the company where I had this issue, so I can't check), but I think the solution ended up involving using a timezone-aware datetime to seed the recurrences?