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 skips first week for weekly events #59

Open
brianmay opened this issue Dec 5, 2021 · 0 comments
Open

Recurrence.get_recurrences/2 skips first week for weekly events #59

brianmay opened this issue Dec 5, 2021 · 0 comments

Comments

@brianmay
Copy link

brianmay commented Dec 5, 2021

For:

iex(13)> ICalendar.from_ics(data) |> Enum.filter(fn x -> x.uid=="[email protected]" end) |> Enum.at(0)                                                                          
%ICalendar.Event{
  attendees: [],
  categories: nil,
  class: nil,
  comment: nil,
  description: nil,
  dtend: #DateTime<2021-12-08 09:00:00+11:00 AEDT Australia/Sydney>,
  dtstart: #DateTime<2021-12-08 07:00:00+11:00 AEDT Australia/Sydney>,
  exdates: [],
  geo: nil,
  location: nil,
  modified: ~U[2021-12-05 10:30:06Z],
  organizer: nil,
  prodid: nil,
  rrule: %{
    byday: ["TH", "WE"],
    freq: "WEEKLY",
    until: ~U[2021-12-17 12:59:59Z],
    wkst: "SU"
  },
  sequence: "3",
  status: "confirmed",
  summary: "Lionel",
  uid: "[email protected]",
  url: nil
}

I would expect events on the 8th and 9th. But I don't get them, events only start after the 2nd week:

iex(12)> ICalendar.from_ics(data) |> Enum.filter(fn x -> x.uid=="[email protected]" end) |> Enum.at(0) |> ICalendar.Recurrence.get_recurrences(~D[2022-01-01]) |> Enum.to_list()
[
  %ICalendar.Event{
    attendees: [],
    categories: nil,
    class: nil,
    comment: nil,
    description: nil,
    dtend: #DateTime<2021-12-16 09:00:00+11:00 AEDT Australia/Sydney>,
    dtstart: #DateTime<2021-12-16 07:00:00+11:00 AEDT Australia/Sydney>,
    exdates: [],
    geo: nil,
    location: nil,
    modified: ~U[2021-12-05 10:30:06Z],
    organizer: nil,
    prodid: nil,
    rrule: %{
      byday: ["TH", "WE"],
      freq: "WEEKLY",
      is_recurrence: true,
      until: ~U[2021-12-17 12:59:59Z],
      wkst: "SU"
    },
    sequence: "3",
    status: "confirmed",
    summary: "Lionel",
    uid: "[email protected]",
    url: nil
  },
  %ICalendar.Event{
    attendees: [],
    categories: nil,
    class: nil,
    comment: nil,
    description: nil,
    dtend: #DateTime<2021-12-15 09:00:00+11:00 AEDT Australia/Sydney>,
    dtstart: #DateTime<2021-12-15 07:00:00+11:00 AEDT Australia/Sydney>,
    exdates: [],
    geo: nil,
    location: nil,
    modified: ~U[2021-12-05 10:30:06Z],
    organizer: nil,
    prodid: nil,
    rrule: %{
      byday: ["TH", "WE"],
      freq: "WEEKLY",
      is_recurrence: true,
      until: ~U[2021-12-17 12:59:59Z],
      wkst: "SU"
    },
    sequence: "3",
    status: "confirmed",
    summary: "Lionel",
    uid: "[email protected]",
    url: nil
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant