A flexbile and typed ICalendar (RFC 5545) library.
- Full implemenation of every ICalendar type (see src/values).
- Generated methods for every ICalendar property with all allowed types
- Support for X & IANA properties and parameters
let ics_str = "BEGIN:VCALENDAR...";
let mut vcal = ICalComponent::from_ics(ics_str)?;
let vtodo = vcal.expect_vtodo();
vtodo.summary("New Summary".to_string());
let new_ics_str = vcal.to_ics();let dtstamp = Tz::America__New_York.with_ymd_and_hms(1992, 12, 17, 12, 34, 56)?;
let vcal = ICalComponent::vcalendar_with_vtodo(
ICalComponent::empty()
.uid_random()
.dtstamp(dtstamp.into())
.percent_complete(10)
.build()
);
let ics_str = vcal.to_ics();Convert Value:
let in_ics = r#"BEGIN:VCALENDAR
X-EXAMPLE:19921217T123456
END:VCALENDAR"#;
let mut vcal = ICalComponent::from_ics(&in_ics)?;
let x_example = vcal.get_prop("X-EXAMPLE")?
.convert_value::<ICalDateTime>()?;Read Later:
let value = vcal.get_prop("X-EXAMPLE")?
.get_as::<ICalDateTime>()?);
println!("{}", value); // 1992-12-17 12:34:56