8

So I looked at Link to add to google calendar, but I want to do the same with an all day event.

I've tried doing dates={date.getUTCDate()}, but the link doesn't take me to a google cal add event page (it just takes me to my calendar), I suspect because the date is wrong.

Thanks

Community
  • 1
  • 1
praks5432
  • 7,246
  • 32
  • 91
  • 156
  • Have you tried the solution in this [thread](http://stackoverflow.com/questions/10763734/how-to-build-html-link-to-a-google-calendar-event)? – ReyAnthonyRenacia May 20 '16 at 19:34
  • Here you can find a comprehensive guide for google calendar properties: https://github.com/InteractionDesignFoundation/add-event-to-calendar-docs/blob/master/services/google.md – Alies Jan 13 '19 at 22:17

1 Answers1

11

If you don't put a time in the link it seems to mark the event as all day, for example: 20160627/20160627

So if you want a one day all day event for June 27 it would look like (using the example from "Link to add to google calendar"):

<a href="http://www.google.com/calendar/event?
action=TEMPLATE
&text=[event-title]
&dates=20160627/20160627
&details=[description]
&location=[location]
&trp=false
&sprop=
&sprop=name:"
target="_blank" rel="nofollow">Add to my calendar</a>

For a 2 day event it would look like (notice you have to add one extra day):

<a href="http://www.google.com/calendar/event?
action=TEMPLATE
&text=[event-title]
&dates=20160627/20160629
&details=[description]
&location=[location]
&trp=false
&sprop=
&sprop=name:"
target="_blank" rel="nofollow">Add to my calendar</a>
mkimmet
  • 749
  • 3
  • 15
  • 27