4
votes

I've been able to programmatically develop a 2 way sync between my Fullcalendar and my Google Calendar using php and javascript. My fullcalendar displays events from a Mysql database as well as events from Google calendar. The problem I am having is that my when my mysql fullcalendar events load into my Google calendar, I then see the mysql events 2x on my fullcalendar...one from mysql and then the one coming back from Google. I need to continue displaying the event created by mysql and discontinue displaying the google events....but only the google events that originated from mysql.

In essense I need to filter out the Google Calendar events that originated from my database, but display google calendar events that were entered manually into the Google Calendar.

When I send the mysql events to google, I currentlty store the returned google calendar id, $gcal_id = $createdEvent->getId() into mysql. My intent is to read the google api callback and filter out the gCal$uid's that match the id's I stored in mysql.

I cannot figure out how to access the gCal$uid values found in the google api callback, and then compare them to an array of id's pulled from the database.

Any ideas or code snippets would be greatly appreciated.

Thank you.

2
can you share your code for the 2 way sync? - Adeerlike
I'd also like to ask that you please share your code for 2 way sync... - Adriaan Nel

2 Answers

3
votes

I attacked the problem from a different angle and was able to solve the problem of duplicate entries appearing on my fullcalendar. As the calendar loads each event, i compare the events id, (minus the @google), to the gcal ids I stored in the database in FullCalendar's "eventAfterRender". If I get a match I use FullCalendar's 'removeEvents' to remove the duplicate event from the Calendar.

0
votes

I'm having inconsistant results. The process will work several times in a row then all of a sudden stop working. I'm still troubleshooting although it's difficult due to the lack of documentation for PHP.

Anyways, the incoming to FullCalendar from Google Calendar is a breeze compared to the outgoing to google calendar.

For the incoming you need to provide instructions to the user on how to attain their Public or Private XML feedk. The steps to get the Public XML are detailed here http://arshaw.com/fullcalendar/docs/google_calendar/

To get the Private XML just don't make your calendar public and then click the XML button in the Private section.

There are some other steps but they are all detailed in the link the provided.

I'll provide more detailed info on the outgoing sync to google once I get it all worked out

BTW- why can't you send me a private message. Is there something I need to change in my stackoverflow settings?