summaryrefslogtreecommitdiff
path: root/README.md
blob: ef11625d5ab77cba31c0a4f04983dfde8265647b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<h1 align="center">RRule.rs</h1>
<p align="center">A pure and efficient Rust implementation of recurrence rules as defined in the iCalendar RFC..</p>
<p align="center">
  <a href="https://travis-ci.com/fmeringdal/rust_rrule"><img src="https://travis-ci.com/fmeringdal/rust_rrule.svg?branch=main" /></a>
  <a href="https://codecov.io/gh/fmeringdal/rust_rrule"><img src="https://codecov.io/gh/fmeringdal/rust_rrule/branch/main/graph/badge.svg" /></a>
  <a href="https://crates.io/crates/rrule"><img src="https://img.shields.io/crates/v/rrule.svg" /></a>
</p>

## 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

```rust
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](https://docs.rs/rrule)

## License

This project is licensed under the [MIT license].

[mit license]: https://github.com/fmeringdal/rust_rrule/blob/main/LICENSE

## Inspired by

- [python-dateutil library](http://labix.org/python-dateutil/)
- [rrule.js](https://github.com/jakubroztocil/rrule)

## TODOS

- cache
- more tests around string parsing and validation