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

Support RRULE with frequency set to YEARLY #199

Open
maciektr opened this issue Sep 8, 2021 · 1 comment
Open

Support RRULE with frequency set to YEARLY #199

maciektr opened this issue Sep 8, 2021 · 1 comment

Comments

@maciektr
Copy link

maciektr commented Sep 8, 2021

Currently, while parsing recurrence rule :invalid_frequency is returned for any rule with frequency YEARLY, although it is supported by the standard.

@spec parse_frequency(String.t()) :: {:ok, Cocktail.frequency()} | {:error, :invalid_frequency}
defp parse_frequency("MONTHLY"), do: {:ok, :monthly}
defp parse_frequency("WEEKLY"), do: {:ok, :weekly}
defp parse_frequency("DAILY"), do: {:ok, :daily}
defp parse_frequency("HOURLY"), do: {:ok, :hourly}
defp parse_frequency("MINUTELY"), do: {:ok, :minutely}
defp parse_frequency("SECONDLY"), do: {:ok, :secondly}
defp parse_frequency(_), do: {:error, :invalid_frequency}

https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.10

       freq        = "SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY"
                   / "WEEKLY" / "MONTHLY" / "YEARLY"
@vanvoljg
Copy link
Contributor

@maciektr That's a good point! There are a places for improvement in our logic, and we would welcome a PR which adds this functionality, provided it's well-tested and doesn't break any existing usage (this package is used in multiple production apps).

I should have some time to work on updating this soon--but probably not this month.

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

2 participants