polishing

This commit is contained in:
Sriram Hariharan
2019-01-09 21:14:18 -06:00
parent 74aed3e64b
commit 5258455db4
4 changed files with 88 additions and 64 deletions

View File

@@ -118,18 +118,20 @@ $(function () {
}
});
$("#export").click(function(){
$("#export").click(function () {
var cal = ics();
var calendarEvents = $('#calendar').fullCalendar('clientEvents');
for(i in calendarEvents){
for (i in calendarEvents) {
let event = calendarEvents[i];
var title = event.title;
var classname = title.substring(0, title.indexOf('with'));
var description = title.substring(title.indexOf('with'));
var time = event.start._d.toUTCString();
cal.addEvent(classname, description, event.building, event.start._i, event.end._i, {rrule: `RRULE:FREQ=WEEKLY;BYDAY=${time.substring(0, time.indexOf(",")-1).toUpperCase()};INTERVAL=1`});
cal.addEvent(classname, description, event.building, event.start._i, event.end._i, {
rrule: `RRULE:FREQ=WEEKLY;BYDAY=${time.substring(0, time.indexOf(",")-1).toUpperCase()};INTERVAL=1`
});
}
cal.download("My_Calendar");
cal.download("My_Course_Calendar");
});
/* convert from the dtarr and maek the time lines*/