From d31a051217bf80ba7da57f4d4f7869d64b7aff96 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 15 Aug 2022 19:41:52 +0200 Subject: [PATCH] wip ics --- src/io.rs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/io.rs b/src/io.rs index a519577..00bd93b 100644 --- a/src/io.rs +++ b/src/io.rs @@ -1,13 +1,19 @@ -use ics::ICalendar; +use ics::{Event, ICalendar}; -pub fn export( - timetable: Vec, - dates: std::collections::HashMap< - usize, - Vec<(chrono::DateTime, chrono::DateTime)>, - >, -) -> ICalendar<'static> { +type T = Vec; +type D = std::collections::HashMap< + usize, + Vec<(chrono::DateTime, chrono::DateTime)>, +>; + +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 }