Consider following example
%ICalendar.Event{dtstart: ~U[2020-12-30 01:01:01Z], rrule: %{freq: "MONTHLY"}}
|> ICalendar.Recurrence.get_recurrences(~U[2022-01-01 01:01:01Z])
The first recurrence is 2021-01-30
Then, as there is no 30th day in February, Timex.shift returns 2021-02-28 (as describe in docs)
All recurrences returned from stream after that point to 28th day of a month (for instance, the third one is 2021-03-28), which I believe is invalid.
To reproduce run:
ICalendar.Recurrence.get_recurrences(
%ICalendar.Event{dtstart: ~U[2020-12-30 01:01:01Z], rrule: %{freq: "MONTHLY"}},
~U[3000-01-01 01:01:01Z]
)
|> Enum.take(3)
|> IO.inspect()