icalendar 0.5.0

Early, minimal icalendar crate.
Documentation

A library (far from anything) to generate icalendars This implementation is still far from complete, I haven't even read the entire spec yet. Instead I implemented the parts I needed first. More to come, contributions very welcome.

Structure

  • Calendars consist of Components
  • Components are e.g. Event or Todo
  • Components consist of Propertys
  • Propertys may have Parameters
# extern crate chrono;
# extern crate icalendar;
# use chrono::*;
# use icalendar::*;
# fn main() {
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);
# }