forked from Anri/cal8tor
mention the name in the correct field, mark the professor as the chairperson and make they accept the rdv
This commit is contained in:
parent
ae14925d9e
commit
52648ac61a
1 changed files with 7 additions and 4 deletions
11
src/ics.rs
11
src/ics.rs
|
@ -2,7 +2,7 @@ use std::sync::Arc;
|
||||||
|
|
||||||
use chrono::TimeZone;
|
use chrono::TimeZone;
|
||||||
use ics::{
|
use ics::{
|
||||||
parameters::{Language, TzIDParam},
|
parameters::{Language, PartStat, Role, TzIDParam, CN},
|
||||||
properties::{
|
properties::{
|
||||||
Attendee, Categories, Class, Description, DtEnd, DtStart, Location, Summary, Transp,
|
Attendee, Categories, Class, Description, DtEnd, DtStart, Location, Summary, Transp,
|
||||||
},
|
},
|
||||||
|
@ -40,9 +40,12 @@ pub fn export(courses: Vec<crate::timetable::models::Course>, filename: &mut Str
|
||||||
|
|
||||||
// Professor's name
|
// Professor's name
|
||||||
if course.professor.is_some() {
|
if course.professor.is_some() {
|
||||||
event.push(Attendee::new(
|
let name = course.professor.unwrap();
|
||||||
"mailto:".to_owned() + &course.professor.unwrap(),
|
let mut contact = Attendee::new(format!("mailto:{name}"));
|
||||||
));
|
contact.add(CN::new(name));
|
||||||
|
contact.add(PartStat::ACCEPTED);
|
||||||
|
contact.add(Role::CHAIR);
|
||||||
|
event.push(contact);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start time of the course
|
// Start time of the course
|
||||||
|
|
Loading…
Reference in a new issue