#calendar #ical #rrule

rrule

A pure Rust implementation of recurrence rules as defined in the iCalendar RFC

25 releases

new 0.5.5 Mar 1, 2021
0.5.3 Feb 15, 2021
0.3.7 Dec 17, 2020
0.3.4 Nov 13, 2020

#22 in Date and time

Download history 43/week @ 2020-11-10 20/week @ 2020-11-17 25/week @ 2020-11-24 267/week @ 2020-12-01 461/week @ 2020-12-08 310/week @ 2020-12-15 344/week @ 2020-12-22 222/week @ 2020-12-29 310/week @ 2021-01-05 427/week @ 2021-01-12 310/week @ 2021-01-19 328/week @ 2021-01-26 184/week @ 2021-02-02 242/week @ 2021-02-09 309/week @ 2021-02-16 121/week @ 2021-02-23

1,274 downloads per month

MIT license

120KB
3K SLoC

RRule.rs

A pure and efficient Rust implementation of recurrence rules as defined in the iCalendar RFC..

Warning

This crate is not production ready yet. Dates and recurrence rules are quite complicated and takes time to get right. Even though this crate is well tested (high code coverage), there are still tests missing regarding edge cases in stuff like DST, time zone and rfc_string parsing (contributions are very welcome!). Use at your own risk!

Quick start

extern crate rrule;

use rrule::RRule;

// RRule that starts 2012.02.01 and occurs daily for 3 days.
let rrule: RRule = "DTSTART:20120201T093000Z\nRRULE:FREQ=DAILY;COUNT=3".parse().unwrap();

// Get all recurrences of the rrule
let recurrences = rrule.all(); // Or rrule.into_iter().collect::<Vec<_>>(); if you want to leverage iterators
assert_eq!(recurrences.len(), 3);

Documentation and more examples

Documentation and more examples

License

This project is licensed under the MIT license.

Inspired by

TODOS

  • cache
  • more tests around string parsing and validation

Dependencies

~2.8–4MB
~86K SLoC