From f7110c254f11232915739ef1c8ce82208998087a Mon Sep 17 00:00:00 2001 From: daladim Date: Sun, 19 Dec 2021 19:13:23 +0100 Subject: [PATCH] Better timestamp parsing --- src/ical/parser.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ical/parser.rs b/src/ical/parser.rs index 027337f..acf408a 100644 --- a/src/ical/parser.rs +++ b/src/ical/parser.rs @@ -123,7 +123,8 @@ pub fn parse(content: &str, item_url: Url, sync_status: SyncStatus) -> Result Result, chrono::format::ParseError> { - Utc.datetime_from_str(dt, "%Y%m%dT%H%M%S") + Utc.datetime_from_str(dt, "%Y%m%dT%H%M%SZ") + .or_else(|_err| Utc.datetime_from_str(dt, "%Y%m%dT%H%M%S") ) } fn parse_date_time_from_property(value: &Option) -> Option> {