mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 14:02:29 +00:00
Add calendar-timezone prop
This commit is contained in:
@@ -125,6 +125,7 @@ pub enum CalendarPropName {
|
||||
Displayname,
|
||||
CalendarColor,
|
||||
CalendarDescription,
|
||||
CalendarTimezone,
|
||||
CalendarOrder,
|
||||
SupportedCalendarComponentSet,
|
||||
SupportedCalendarData,
|
||||
@@ -144,6 +145,8 @@ pub enum CalendarProp {
|
||||
CalendarColor(TextNode),
|
||||
#[serde(rename = "C:calendar-description", alias = "calendar-description")]
|
||||
CalendarDescription(TextNode),
|
||||
#[serde(rename = "C:calendar-timezone", alias = "calendar-timezone")]
|
||||
CalendarTimezone(TextNode),
|
||||
#[serde(rename = "IC:calendar-description", alias = "calendar-description")]
|
||||
CalendarOrder(TextNode),
|
||||
#[serde(
|
||||
@@ -202,6 +205,9 @@ impl Resource for CalendarFile {
|
||||
CalendarPropName::CalendarDescription => Ok(CalendarProp::CalendarDescription(
|
||||
TextNode(self.calendar.description.clone()),
|
||||
)),
|
||||
CalendarPropName::CalendarTimezone => Ok(CalendarProp::CalendarTimezone(TextNode(
|
||||
self.calendar.timezone.clone(),
|
||||
))),
|
||||
CalendarPropName::CalendarOrder => Ok(CalendarProp::CalendarOrder(TextNode(
|
||||
format!("{}", self.calendar.order).into(),
|
||||
))),
|
||||
@@ -244,6 +250,10 @@ impl Resource for CalendarFile {
|
||||
self.calendar.description = description;
|
||||
Ok(())
|
||||
}
|
||||
CalendarProp::CalendarTimezone(TextNode(timezone)) => {
|
||||
self.calendar.timezone = timezone;
|
||||
Ok(())
|
||||
}
|
||||
CalendarProp::CalendarOrder(TextNode(order)) => {
|
||||
self.calendar.order = match order {
|
||||
Some(order) => order.parse().map_err(|_e| anyhow!("invalid order"))?,
|
||||
|
||||
Reference in New Issue
Block a user