Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link to add all day event to Google Calendar

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

like image 433
praks5432 Avatar asked May 19 '16 23:05

praks5432


1 Answers

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>
like image 68
mkimmet Avatar answered Sep 20 '22 00:09

mkimmet