Posted: June 9, 2013 at 8:28 pm
|
Hi Guys Looking over previous threads it looks like it has been asked before but I couldn’t find any solutions? It looks like the link seems simply enough below. I am not a coder but I guess you would pass the event variables into it somehow <a href=”http://www.google.com/calendar/event?action=TEMPLATE&text=Your%20Event%20Name&dates=20130614T230000Z/20130614T183000Z&details=&location=Venue%20Name%20Here&trp=false&sprop=Business%20Name%20Here&sprop=name:www.yourbusinessname.com” target=”_blank”><img alt=”” src=”//www.google.com/calendar/images/ext/gc_button1.gif” border=”0″ /></a> thanks for your help, cheers
|
|
Hi, Well, as you have probably discovered you can manually add links into the event description using this https://support.google.com/calendar/answer/3033039 to generate a button. Converting it over to something coded is a little harder. I have made this here https://gist.github.com/Apina/273425ce2c2c62af6d17 but I can tell you now it is not perfect, especially the time, as Google Calendar seems to work on a GMT/UTC basis, and I couldnt get my head around how to get that working. Perhaps by opening it up here, others may be able to assist in getting that bit working. |
|
Hi Dean Thanks for the reply. Yes, preferably I would like this dynamic as creating links to many events would become quite laborious. I did think the time format would be a little tricky just looking at it. Anyway I hope someone steps in. It would be a great feature for EE I think in addition to the ical as I and many others use Google calendar as their main e-calendar and it would be great to offer the choice. cheers Von |
|
Hi, I updated the gist. I think I have it now. In my tests if I set WordPress time to New York, and have an event that starts at 2am there, it shows (correctly) as 9am for me in Google Calendar. If I swap the time to Helsinki then that same 2am event correctly shows as 2am for me in Google Calendar. Would love it if you could test it a bit and make sure that it is doing as planned. |
|
Hi Dean thanks for your help and time with this one. I gave it a try out and for some reason it isn’t working too well for me. I am still on 3.1.32.2.P, not sure if that should make a difference. Anyway here is the url it is outputting. As you can see org name and website is parsed but I get a 1970’s date and no location or event name http://www.google.com/calendar/event?action=TEMPLATE&text=&dates=19700101T000000Z/19700101T000000Z&details=&location=,,,,,,,&trp=false&sprop=My%20Business%20Name&sprop=name:http://www.mywebsite.com cheers |
|
Hi, Thanks for that. OK, i will have another look at it. I believe the location may be down to whether you are using the Venue Manager or not (it needs it). Not sure why the name isnt working for you. What date format are you using (eg, 31/12/2013, 12/31/2013, etc)? |
|
Hi Dean Yes I am using venue manager. I am using dd/mm/yy (the proper date format of course ; )
|
|
The gist works when placed in the event_list_display.php, but in the registration_page_display.php, the $event object is not available. I’m trying some modifications now to see if I can get around that. |
|
I made the promised modifications: |
|
Hi Guys Great work so far. I did a few tests on the code. Here is what I found It doesn’t work for me currently with my custom date format as d/m/y. It also doesn’t work with date set as d/m/Y. I still get the 1970’s date as per above When I switch WP settings to m/d/Y it works but for some reason I get a day added to the start date and the end date displays correctly. I.e if the event date was 6/15/13 the google event would display start date 6/16/13 and the end date as 6/15/13. I double checked my event, and both start and end dates were set as 6/15/13. All other details are correct parsed to google though including times, venue, description etc It seems funny to me that it’s not working with the d/m/Y format it looks like you are extracting the day, month and year separately and rejoining them for google. thanks once again
|
|
I did some changes to the gist to make it work with any date format: |
|
And another update. https://gist.github.com/Apina/273425ce2c2c62af6d17 After working with Sidney, we found the variables needed changing a little and strip HTML out of the description. I have found no issues now with EU or other date formats than US, and also the weird day ahead/behind thing should be resolved. |
|
wow thanks guys for your time. I tried out the latest version and for some reason I am still getting the start date +1 day problem. I am not sure what’s going on, perhaps it is just my setup? I tried both system date setups of d/m/y and d/m/Y (not sure if it affects the code?) and get the same error. |
|
Hey No worries, it’s taking longer than I thought it would but i think it would be a nice cool addition to the plugin. Do you have an example page we could look at showing the issue? Can you also advise what the dates should be here as well as we had one problem where the post dates were being modified incorrectly. |
|
Hi Dean just so my website url isnt displayed here, I have just sent a email through to sales@ with details, hopefully they can forward to you, cheers The other idea I had for this one was to have the link on the payment overview page, just so it doesn’t disrupt the flow of the customer completing form and payment, i.e save it for the end when the purchase has been made
|
Hi Von, We have received your email and forwarded it to Dean. |
|
The support post ‘Add to google calendar’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.