Skip to content
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

Recurrence.get_recurrences/2 returns invalid dates after passing leap day once in the recurrence stream #58

Open
maciektr opened this issue Sep 3, 2021 · 0 comments
Labels

Comments

@maciektr
Copy link

maciektr commented Sep 3, 2021

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()
@lpil lpil added the bug label Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants