hi all, first of all—thank you for a wonderful library!
i've encountered what seems to be a daylight savings issue in 0.10.3 when trying to generate occurences across the daylight savings boundary. when attempting to pull DateTimes after the boundary the stream seems to enter some sort of infinite loop and does not return. here's a reproduction:
{:ok, schedule} = Cocktail.Schedule.from_i_calendar("DTSTART;TZID=America/Toronto:20230101T000000\nRRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR")
timezone = "America/Toronto"
start = ~D[2024-03-01] |> DateTime.new!(~T[00:00:00], timezone)
stop = ~D[2024-03-15] |> DateTime.new!(~T[00:00:00], timezone)
stream = schedule |> Cocktail.Schedule.end_all_recurrence_rules(stop) |> Cocktail.Schedule.occurrences(start)
note: daylight savings begins on March 10, 2024. so if we take take the first four occurrences they should fall just before the boundary:
iex> stream |> Enum.take(4)
[#DateTime<2024-03-01 00:00:00-05:00 EST America/Toronto>,
#DateTime<2024-03-04 00:00:00-05:00 EST America/Toronto>,
#DateTime<2024-03-06 00:00:00-05:00 EST America/Toronto>,
#DateTime<2024-03-08 00:00:00-05:00 EST America/Toronto>]
now, the next occurrence should fall on March 11, 2024, if we attempt to take the first five occurrences the code will hang indefinitely:
iex> stream |> Enum.take(5)
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
(l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
^C
hi all, first of all—thank you for a wonderful library!
i've encountered what seems to be a daylight savings issue in
0.10.3when trying to generate occurences across the daylight savings boundary. when attempting to pull DateTimes after the boundary the stream seems to enter some sort of infinite loop and does not return. here's a reproduction:note: daylight savings begins on March 10, 2024. so if we take take the first four occurrences they should fall just before the boundary:
now, the next occurrence should fall on March 11, 2024, if we attempt to take the first five occurrences the code will hang indefinitely: