I am currently creating a simple sign in sheet that connects to the Google Calendar API. When user enters the prompted information, which includes start Datetime and Endtime, it should create a calendar event based on the user input. I managed to make it so it makes a calendar event. However, the timing are really strange and I don't understand how the times are derived.
For the code below, I would assume that it would create a Calendar event on 2016-12-16 at 2pm, but it doesn't, it creates an event at 2016-12-16 at 9am. Why is that? Thank you!
function makeEvent(){
//Get the variable details
var eventDet = getInput();
var event = {
'summary': eventDet[0] + ' Appointment',
'description': 'Telephone #: ' + eventDet[1] + ' Client Status: ' + eventDet[3],
'start': {
'dateTime': '2016-12-16T14:00:00Z',
'timeZone': 'America/New_York'
},
'end': {
'dateTime': '2016-12-16T14:00:00Z',
'timeZone': 'America/New_York'
},
'attendees': [
{'email': 'lpage@example.com'},
{'email': 'sbrin@example.com'}
],
'reminders': {
'useDefault': false,
'overrides': [
{'method': 'email', 'minutes': 24 * 60},
{'method': 'popup', 'minutes': 10}
]
}
};