Some small fixes on recurrence expansion

This commit is contained in:
Lennart
2025-12-31 19:54:06 +01:00
parent 9c1cd24d32
commit 44ae995f29
12 changed files with 887 additions and 46 deletions

View File

@@ -198,6 +198,14 @@ impl CalDateTime {
}
}
#[must_use]
pub fn with_timezone(&self, tz: &ICalTimezone) -> Self {
match self {
Self::DateTime(datetime) => Self::DateTime(datetime.with_timezone(tz)),
Self::Date(date, _) => Self::Date(date.to_owned(), tz.to_owned()),
}
}
pub fn parse(value: &str, timezone: Option<Tz>) -> Result<Self, CalDateTimeError> {
if let Ok(datetime) = NaiveDateTime::parse_from_str(value, LOCAL_DATE_TIME) {
if let Some(timezone) = timezone {