From cf7af66828ccce6ded05c628a3cc3bff3a2227e6 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 18 Aug 2022 12:37:40 +0200 Subject: [PATCH] add utc info onutc datetime and add lang on course's name --- src/ics.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ics.rs b/src/ics.rs index a7409d8..88c4ab2 100644 --- a/src/ics.rs +++ b/src/ics.rs @@ -13,7 +13,8 @@ pub fn export(courses: Vec, filename: String) calendar.add_timezone(ics::TimeZone::standard( timezone_name, Standard::new( - dt_ical(chrono::Utc.ymd(1970, 1, 1).and_hms(0, 0, 0)), + // Add a Z because it's UTC + dt_ical(chrono::Utc.ymd(1970, 1, 1).and_hms(0, 0, 0)) + "Z", "+0100", "+0200", ), @@ -23,7 +24,8 @@ pub fn export(courses: Vec, filename: String) for course in courses { let mut event = Event::new( uuid::Uuid::new_v4().to_string(), - dt_ical(chrono::Utc::now()), + // Add a Z because it's UTC + dt_ical(chrono::Utc::now()) + "Z", ); // Public event @@ -51,7 +53,9 @@ pub fn export(courses: Vec, filename: String) event.push(Location::new(course.room)); // Course's name - event.push(Summary::new(course.name)); + let mut course_name = Summary::new(course.name); + course_name.append(parameters!("LANGUAGE" => "fr")); + event.push(course_name); // Add the course to the calendar calendar.add_event(event);