recurring_events v0.1.0 RecurringEvents.ByMonth

Handles :by_month rule

Summary

Functions

Applies :by_month rule to given date and returns enumerable. Depends on other rules it may create additional dates keep one provided or remove it. See tests for details

Functions

unfold(date, rules)

Applies :by_month rule to given date and returns enumerable. Depends on other rules it may create additional dates keep one provided or remove it. See tests for details.

Examples

iex> RecurringEvents.ByMonth.unfold(~D[2017-01-22],
...>       %{freq: :yearly, by_month: [1, 2, 3]})
...> |> Enum.take(10)
[~D[2017-01-22], ~D[2017-02-22], ~D[2017-03-22]]

iex> RecurringEvents.ByMonth.unfold(~D[2017-01-22],
...>       %{freq: :monthly, by_month: [1, 2, 3]})
...> |> Enum.take(10)
[~D[2017-01-22]]