How to update an event in Google Calendar using javascript?

前端 未结 4 1274
萌比男神i
萌比男神i 2021-01-17 04:49

I need to update the name of some Google Calendar events, once I get them through JavaScript. I only have the sample code which Google shows in their Google Developer site,

4条回答
  •  不知归路
    2021-01-17 05:30

    5+ years after the question was asked, here is how I succeeded:

    /**
     * changes transparency (i.e. Busy or Available) of event passed
     * 
     * @author dugBarnz
     * @version 1.0
     * @since 2021/01/11
     * @param {string} event id
     */
    function zzChangeTransparency_(_calendarId, _eventId)
    {
      var event = Calendar.Events.get(_calendarId, _eventId);
      if (event && event.transparency)
        event.transparency = "opaque";
      else
        event.transparency = "transparent";
    
      Calendar.Events.update(event, _calendarId, _eventId);
    }
    

提交回复
热议问题