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