Implemented create_calendar for caldav client

This commit is contained in:
daladim 2021-04-20 00:01:15 +02:00
parent 26c49a85c2
commit 5322f04d83
3 changed files with 44 additions and 1 deletions

View file

@ -18,6 +18,19 @@ bitflags! {
}
}
impl SupportedComponents {
pub fn to_xml_string(&self) -> String {
format!(r#"
<C:supported-calendar-component-set>
{} {}
</C:supported-calendar-component-set>
"#,
if self.contains(Self::EVENT) { "<C:comp name=\"VEVENT\"/>" } else { "" },
if self.contains(Self::TODO) { "<C:comp name=\"VTODO\"/>" } else { "" },
)
}
}
impl TryFrom<minidom::Element> for SupportedComponents {
type Error = Box<dyn Error>;