Skip to content

Instantly share code, notes, and snippets.

@sushain97
Created July 20, 2014 20:10
Show Gist options
  • Save sushain97/67de550b695aee34634b to your computer and use it in GitHub Desktop.
Save sushain97/67de550b695aee34634b to your computer and use it in GitHub Desktop.
function addVisitToCalendar(event) {
var calendarName = 'sushain@skc.name', //The default calendar name = email address (?)
eventLocation = 'College Center',
collegeName = 'College Name',
startTime = 'Start Time',
endTime = 'End Time',
description = 'Notes';
var values = event.namedValues;
var event = CalendarApp.getCalendarsByName(calendarName)[0].createEvent(values[collegeName],
new Date(values[startTime]),
new Date(values[endTime]),
{
description: values[description],
location: eventLocation
});
Logger.log('Added event: ' + event.getId());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment