davepar / gcalendarsync

Apps Script for syncing a Google Spreadsheet with Google Calendar
MIT License
161 stars 46 forks source link

All Day Events Across Multiple Days #11

Closed JerNab closed 7 years ago

JerNab commented 7 years ago

Hello,

I like your script as it is much more advanced than what I have created on my own. I did find a workaround to the all day events that span multiple days. In my script, I use this but I am not sure how to incorporate this into your script. What I am looking to do is only push All Day Events or at least ones that look like All Day Events. I don't care about times just pushing a multi day event. How can you incorporate this into your script?

var start = Utilities.formatDate(new Date(startd), "GMT"-0500, "MM-dd-yyyy");
var end = Utilities.formatDate(new Date(stopd), "GMT"-0500, "MM-dd-yyyy");

var newEvent = calend.createEventFromDescription(title+" "+start+"-"+end).;

davepar commented 7 years ago

That's an interesting work-around. So you basically put the start and end time in the description and let GCalendar parse it. I'll try to incorporate that over the next few days. Thanks for the tip.

davepar commented 7 years ago

I found a different way to handle multi-day all-day events. The script basically now just treats them like any other event. When syncing from the sheet to calendar it won't show up as an all day event, but it looks the same in Calendar.