peek-travel / cocktail

Elixir date recurrence library based on iCalendar events
https://hexdocs.pm/cocktail
MIT License
222 stars 30 forks source link

Understanding `Cocktail.Schedule.t` recurrence_rules #173

Open yordis opened 3 years ago

yordis commented 3 years ago

Hey folks, I am a bit confused why Cocktail.Schedule.t has a list of recurrence_rules, here https://github.com/peek-travel/cocktail/blob/2b12aa0d8cecb0ef58e08d9dba6d9646f8a4e419/lib/cocktail/schedule.ex#L39

Following this Stackoverflow question: https://stackoverflow.com/questions/38296679/icalendar-spec-rrule-multiple-times it seems that based on https://datatracker.ietf.org/doc/html/rfc5545 specification

"but it SHOULD NOT be specified more than once. The recurrence set generated with multiple "RRULE" properties is undefined."

So technically this suppose to be a single value

doughsay commented 3 years ago

Yes, this is a deviation from the spec due to my misunderstanding of it when I first built it. I'm open to having this change, but it would be major breaking change and I use this library in production with multiple rrules per schedule.

yordis commented 3 years ago

@doughsay I am curious to know your use case by the way?

I don't have a strong feeling about it, for the most part, I actually need excal if excal implements some parser and uses some structured data as I explained in another comment.

So I would like to learn why you needed multiple rules behind.

Also, since I don't know the history, I would love to learn about cocktail vs excal and how you ended up with two of them.

Sorry for bothering you so much with this, but hopefully your package stay with me for a long time and I don't have to create "yet another same old same package fixing a minor thing" 😄