summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 9cd132f7122f6ef3a6d3042c5ffeed5b1f45712f (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
# iCalendar in Rust

[![Travis](https://img.shields.io/travis/hoodie/icalendar-rs.svg)](https://travis-ci.org/hoodie/icalendar-rs/)
[![license](https://img.shields.io/crates/l/icalendar.svg)](https://crates.io/crates/icalendar/)
[![Crates.io](https://img.shields.io/crates/d/icalendar.svg)](https://crates.io/crates/icalendar)
[![version](https://img.shields.io/crates/v/icalendar.svg)](https://crates.io/crates/icalendar/)
[![documentation](https://docs.rs/icalendar/badge.svg)](https://docs.rs/icalendar/)

A very WIP library to generate rfc5545 calendars.
This is still just an early idea, there is not much implemented yet.
I haven't even read the full [spec](http://tools.ietf.org/html/rfc5545) yet.

You want to help make this more mature? Please talk to me, Pull Requests and suggestions are very welcome.

## Examples

```rust
let event = Event::new()
    .summary("test event")
    .description("here I have something really important to do")
    .starts(UTC::now())
    .class(Class::Confidential)
    .ends(UTC::now() + Duration::days(1))
    .append_property(Property::new("TEST", "FOOBAR")
              .add_parameter("IMPORTANCE", "very")
              .add_parameter("DUE", "tomorrow")
              .done())
    .done();

let bday = Event::new()
    .all_day(UTC.ymd(2016, 3, 15))
    .summary("My Birthday")
    .description(
r#"Hey, I'm gonna have a party
BYOB: Bring your own beer.
Hendrik"#
)
    .done();

let todo = Todo::new().summary("Buy some milk").done();


let mut calendar = Calendar::new();
calendar.add(event);
calendar.add(todo);
calendar.add(bday);
```

# License