Reputation: 1
I would like to have a Google Sheet that syncs with a Google Calendar to help keep my editorial calendar more organized. I've found some great code online that does 90% of what I need, but the code is primarily for event management. All of my entries will be all-day events, so I don't really need the start and end time feature.
Here is what I would like to accomplish:
The original developer was kind enough to include a spreadsheet template.
I tried changing the name of column C on the spreadsheet to Date and then updating var titleRow
in row 10, but I get the following error message:
Spreadsheet must have Title, Start Time, End Time, All Day Event, and Id columns
Any suggestions on how to correct the error? What about defaulting to all-day events? Any advice is greatly appreciated!
Upvotes: 0
Views: 315
Reputation: 6791
Try using the Calendar Service
createAllDayEvent(title, date)
- Creates a new all-day event.
createAllDayEvent(title, date, options)
- Creates a new all-day event.(with options)
createAllDayEventSeries(title, startDate, recurrence)
- Creates a new all-day event series.
createAllDayEventSeries(title, startDate, recurrence, options)
- Creates a new all-day event series.(with options)
Code sample for all-day events series(with options)
// Creates an event series for a no-meetings day, taking place every Wednesday in 2013.
var eventSeries = CalendarApp.getDefaultCalendar().createAllDayEventSeries('No Meetings',
new Date('January 2, 2013 03:00:00 PM EST'),
CalendarApp.newRecurrence().addWeeklyRule()
.onlyOnWeekday(CalendarApp.Weekday.WEDNESDAY)
.until(new Date('January 1, 2014')),
{guests: '[email protected]'});
Logger.log('Event Series ID: ' + eventSeries.getId());
Creating an event as a all day event, we use createAllDayEvent / createAllDayEventSeries function. For the series it will use the recurrence and some additional parameters like location, description, guest, sendInvites.
Hope this helps
Upvotes: 0