From f64128e0b16dd37964733d2bbf05915990f3a224 Mon Sep 17 00:00:00 2001 From: philipp Date: Mon, 5 Jun 2023 13:27:08 +0200 Subject: [PATCH] Use crlf --- src/model/planned_event.rs | 58 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/model/planned_event.rs b/src/model/planned_event.rs index 4a73912..97dcb71 100644 --- a/src/model/planned_event.rs +++ b/src/model/planned_event.rs @@ -208,51 +208,51 @@ FROM user_trip WHERE trip_details_id = (SELECT trip_details_id FROM planned_even pub async fn get_ics_feed(db: &SqlitePool) -> String { let mut res = String::from( - r#"BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//rudernlinz.at//Trips//DE -X-WR-CALNAME:Ruderausfahrten -BEGIN:VTIMEZONE -TZID:Europe/Vienna -TZURL:http://tzurl.org/zoneinfo-outlook/Europe/Vienna -X-LIC-LOCATION:Europe/Vienna -BEGIN:DAYLIGHT -TZOFFSETFROM:+0100 -TZOFFSETTO:+0200 -TZNAME:CEST -DTSTART:19700329T020000 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU -END:DAYLIGHT -BEGIN:STANDARD -TZOFFSETFROM:+0200 -TZOFFSETTO:+0100 -TZNAME:CET -DTSTART:19701025T030000 -RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU -END:STANDARD + r#"BEGIN:VCALENDAR\r\n +VERSION:2.0\r\n +PRODID:-//rudernlinz.at//Trips//DE\r\n +X-WR-CALNAME:Ruderausfahrten\r\n +BEGIN:VTIMEZONE\r\n +TZID:Europe/Vienna\r\n +TZURL:http://tzurl.org/zoneinfo-outlook/Europe/Vienna\r\n +X-LIC-LOCATION:Europe/Vienna\r\n +BEGIN:DAYLIGHT\r\n +TZOFFSETFROM:+0100\r\n +TZOFFSETTO:+0200\r\n +TZNAME:CEST\r\n +DTSTART:19700329T020000\r\n +RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU\r\n +END:DAYLIGHT\r\n +BEGIN:STANDARD\r\n +TZOFFSETFROM:+0200\r\n +TZOFFSETTO:+0100\r\n +TZNAME:CET\r\n +DTSTART:19701025T030000\r\n +RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\r\n +END:STANDARD\r\n END:VTIMEZONE"#, ); let events = PlannedEvent::all(db).await; for event in events { - res.push_str("\nBEGIN:VEVENT"); - res.push_str(&format!("\nUID:{}@rudernlinz.at", event.id)); + res.push_str("\nBEGIN:VEVENT\r\n"); + res.push_str(&format!("\nUID:{}@rudernlinz.at\r\n", event.id)); res.push_str(&format!( - "\nDTSTART;TZID=Europe/Vienna:{}T{}00", + "\nDTSTART;TZID=Europe/Vienna:{}T{}00\r\n", event.day.replace('-', ""), event.planned_starting_time.replace(':', "") )); res.push_str(&format!( - "\nDTSTAMP;TZID=Europe/Vienna:{}T{}00", + "\nDTSTAMP;TZID=Europe/Vienna:{}T{}00\r\n", event.day.replace('-', ""), event.planned_starting_time.replace(':', "") )); - res.push_str(&format!("\nSUMMARY:{}", event.name)); + res.push_str(&format!("\nSUMMARY:{}\r\n", event.name)); - res.push_str("\nEND:VEVENT"); + res.push_str("\nEND:VEVENT\r\n"); } - res.push_str("\nEND:VCALENDAR"); + res.push_str("\nEND:VCALENDAR\r\n"); res } }