forked from Anri/cal8tor
wip ics
This commit is contained in:
parent
ab78a9d221
commit
d31a051217
1 changed files with 14 additions and 8 deletions
22
src/io.rs
22
src/io.rs
|
@ -1,13 +1,19 @@
|
|||
use ics::ICalendar;
|
||||
use ics::{Event, ICalendar};
|
||||
|
||||
pub fn export(
|
||||
timetable: Vec<crate::timetable::models::Day>,
|
||||
dates: std::collections::HashMap<
|
||||
usize,
|
||||
Vec<(chrono::DateTime<chrono::Utc>, chrono::DateTime<chrono::Utc>)>,
|
||||
>,
|
||||
) -> ICalendar<'static> {
|
||||
type T = Vec<crate::timetable::models::Day>;
|
||||
type D = std::collections::HashMap<
|
||||
usize,
|
||||
Vec<(chrono::DateTime<chrono::Utc>, chrono::DateTime<chrono::Utc>)>,
|
||||
>;
|
||||
|
||||
pub fn export(_timetable: T, _dates: D) -> ICalendar<'static> {
|
||||
let mut calendar = ICalendar::new("2.0", "cal8tor");
|
||||
|
||||
let event = Event::new("uid", "dtstamp");
|
||||
|
||||
calendar.add_event(event);
|
||||
|
||||
calendar.save_file("target/debug2.ics").unwrap();
|
||||
|
||||
calendar
|
||||
}
|
||||
|
|
Reference in a new issue