An Elixir library for generating date recurrences based on iCalendar events, supporting schedules with complex rules.
Cocktail is an Elixir library for generating date recurrences based on the iCalendar standard. It solves the problem of defining and expanding complex repeating schedules, such as events that occur on specific days and times with custom intervals. Developers use it to create streams of occurrences from recurrence rules, making it useful for calendar applications, reminders, and scheduling systems.
Elixir developers building applications that require handling of recurring events, such as calendar systems, booking platforms, or reminder services. It's particularly useful for those needing iCalendar compatibility.
Developers choose Cocktail for its adherence to the iCalendar standard, functional Elixir API, and efficient stream-based occurrence generation. It offers a robust alternative to manual date calculations and integrates seamlessly with Elixir's ecosystem.
Elixir date recurrence library based on iCalendar events
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements RFC 5545 for recurrence rules, enabling seamless conversion to and from iCalendar format, as shown in the to_i_calendar/1 and from_i_calendar/1 functions.
Supports frequencies like daily, weekly, and monthly with customizable intervals, days, and hours, demonstrated in the add_recurrence_rule/3 examples.
Generates lazy streams of occurrences using Elixir's Stream.unfold, allowing memory-efficient handling of large or infinite series, as highlighted in the occurrences/1 function.
Allows adding specific recurrence times and excluding times with add_recurrence_time/2 and add_exception_time/2, providing flexibility for irregular schedules.
The roadmap admits missing support for EXRULE, week-start option, and full RRULE options, which may limit interoperability for advanced calendar systems.
As an Elixir-specific library, it cannot be used in other programming environments, restricting its utility in polyglot or non-Elixir projects.
The README notes ongoing investigation into DST bugs with zoned DateTime, indicating that timezone handling might be unreliable or require careful testing.