2 way sync Google Calendar with Fullcalendar

10,197

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.

Share:
10,197
user1344131
Author by

user1344131

Updated on June 04, 2022

Comments

  • user1344131
    user1344131 almost 2 years

    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.