fix ics
This commit is contained in:
parent
f64128e0b1
commit
51b0ba8cf4
@ -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\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
|
||||
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
|
||||
END:VTIMEZONE"#,
|
||||
);
|
||||
|
||||
let events = PlannedEvent::all(db).await;
|
||||
for event in events {
|
||||
res.push_str("\nBEGIN:VEVENT\r\n");
|
||||
res.push_str(&format!("\nUID:{}@rudernlinz.at\r\n", event.id));
|
||||
res.push_str("\nBEGIN:VEVENT");
|
||||
res.push_str(&format!("\nUID:{}@rudernlinz.at", event.id));
|
||||
res.push_str(&format!(
|
||||
"\nDTSTART;TZID=Europe/Vienna:{}T{}00\r\n",
|
||||
"\nDTSTART;TZID=Europe/Vienna:{}T{}00",
|
||||
event.day.replace('-', ""),
|
||||
event.planned_starting_time.replace(':', "")
|
||||
));
|
||||
res.push_str(&format!(
|
||||
"\nDTSTAMP;TZID=Europe/Vienna:{}T{}00\r\n",
|
||||
"\nDTSTAMP;TZID=Europe/Vienna:{}T{}00",
|
||||
event.day.replace('-', ""),
|
||||
event.planned_starting_time.replace(':', "")
|
||||
));
|
||||
res.push_str(&format!("\nSUMMARY:{}\r\n", event.name));
|
||||
res.push_str(&format!("\nSUMMARY:{}", event.name));
|
||||
|
||||
res.push_str("\nEND:VEVENT\r\n");
|
||||
res.push_str("\nEND:VEVENT");
|
||||
}
|
||||
|
||||
res.push_str("\nEND:VCALENDAR\r\n");
|
||||
res.push_str("\nEND:VCALENDAR");
|
||||
res
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user