What parameters are required to create an “Add to Google Calendar” link?

前端 未结 4 900
难免孤独
难免孤独 2020-12-04 08:36

We can use this link to add a new event to Google Calendar by parameters

https://www.google.com/calendar/render?
actio         


        
4条回答
  •  情书的邮戳
    2020-12-04 08:38

    These are the parameters that I use when I create these links. There are other parameters that exist, but I don't find them useful and they are optional. The details about how the dates work are particularly vexing and were never sufficiently documented by google.

    • action=TEMPLATE (required)
    • text (url encoded name of the event)
    • dates (ISO date format, startdate/enddate - must have both start and end time or it won't work. The start and end date can be the same if appropriate.)
      • to use the user's timezone: 20161208T160000/20161208T180000
      • to use global time, convert to UTC, then use 20131208T160000Z/20131208T180000Z
      • all day events, you can use 20161208/20161209 - note that the old google documentation gets it wrong. You must use the following date as the end date for a one day all day event, or +1 day to whatever you want the end date to be.
    • details (url encoded event description/details)
    • location (url encoded location of the event - make sure it's an address google maps can read easily)

提交回复
热议问题