|0.6.0||Sep 23, 2021|
|0.5.9||Jul 2, 2021|
|0.5.8||May 16, 2021|
|0.5.5||Mar 1, 2021|
|0.3.4||Nov 13, 2020|
#8 in Date and time
5,157 downloads per month
Used in 3 crates (via nettu_scheduler_domain)
A pure and efficient Rust implementation of recurrence rules as defined in the iCalendar RFC..
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!
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);
See more examples at docs.rs
Install the command line tool with:
$ cargo install rrule
Then run it with:
$ rrule "DTSTART:20120201T093000Z\nRRULE:FREQ=DAILY;COUNT=3"
This project is licensed under the MIT license.
- more tests around string parsing and validation