forked from Anri/cal8tor
better usage of the lib API
This commit is contained in:
parent
6c9ccff574
commit
4d0f14d045
1 changed files with 4 additions and 4 deletions
|
@ -2,7 +2,7 @@ use std::sync::Arc;
|
||||||
|
|
||||||
use chrono::TimeZone;
|
use chrono::TimeZone;
|
||||||
use ics::{
|
use ics::{
|
||||||
parameters,
|
parameters::{Language, TzIDParam},
|
||||||
properties::{
|
properties::{
|
||||||
Categories, Class, Comment, Description, DtEnd, DtStart, Location, Summary, Transp,
|
Categories, Class, Comment, Description, DtEnd, DtStart, Location, Summary, Transp,
|
||||||
},
|
},
|
||||||
|
@ -45,12 +45,12 @@ pub fn export(courses: Vec<crate::timetable::models::Course>, filename: &mut Str
|
||||||
|
|
||||||
// Start time of the course
|
// Start time of the course
|
||||||
let mut date_start = DtStart::new(dt_ical(course.dtstart.unwrap()));
|
let mut date_start = DtStart::new(dt_ical(course.dtstart.unwrap()));
|
||||||
date_start.append(parameters!("TZID" => timezone_name));
|
date_start.add(TzIDParam::new(timezone_name));
|
||||||
event.push(date_start);
|
event.push(date_start);
|
||||||
|
|
||||||
// End time of the course
|
// End time of the course
|
||||||
let mut date_end = DtEnd::new(dt_ical(course.dtend.unwrap()));
|
let mut date_end = DtEnd::new(dt_ical(course.dtend.unwrap()));
|
||||||
date_end.append(parameters!("TZID" => timezone_name));
|
date_end.add(TzIDParam::new(timezone_name));
|
||||||
event.push(date_end);
|
event.push(date_end);
|
||||||
|
|
||||||
// Room location
|
// Room location
|
||||||
|
@ -65,7 +65,7 @@ pub fn export(courses: Vec<crate::timetable::models::Course>, filename: &mut Str
|
||||||
|
|
||||||
// Course's name
|
// Course's name
|
||||||
let mut course_name = Summary::new(format!("{} - {}", categories, course.name));
|
let mut course_name = Summary::new(format!("{} - {}", categories, course.name));
|
||||||
course_name.append(parameters!("LANGUAGE" => "fr"));
|
course_name.add(Language::new("fr"));
|
||||||
event.push(course_name);
|
event.push(course_name);
|
||||||
|
|
||||||
// Course's category
|
// Course's category
|
||||||
|
|
Loading…
Reference in a new issue