#calendar #ical #rrule

bin+lib rrule

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

29 releases

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

Download history 1131/week @ 2021-06-30 1100/week @ 2021-07-07 1334/week @ 2021-07-14 1560/week @ 2021-07-21 1796/week @ 2021-07-28 1296/week @ 2021-08-04 940/week @ 2021-08-11 1136/week @ 2021-08-18 879/week @ 2021-08-25 686/week @ 2021-09-01 1064/week @ 2021-09-08 1731/week @ 2021-09-15 1112/week @ 2021-09-22 1581/week @ 2021-09-29 888/week @ 2021-10-06 876/week @ 2021-10-13

5,157 downloads per month
Used in 3 crates (via nettu_scheduler_domain)

MIT license

140KB
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!

Library Usage

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

Command Line Tool Usage

Install the command line tool with:

$ cargo install rrule

Then run it with:

$ rrule "DTSTART:20120201T093000Z\nRRULE:FREQ=DAILY;COUNT=3"

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