Google Calendar Synchronization

Hi, I would like to give users of my application the ability to synchronize their google calendar with the scheduler component. 

I saw the example on your site but it expects the calendarid and publickey in the code. How could they be made dynamic?

Thanks a lot.

1 Reply 1 reply marked as answer

BS Balasubramanian Sattanathan Syncfusion Team February 17, 2021 12:42 PM UTC

Hi Marco, 

Greetings from Syncfusion Support. 

We have validated your requirement at our end and suspect that your need is to change the events dynamically from different google calendars. We have prepared a sample based on that by making use of the below code snippet. And also suggest you to refer the below links to get calendarId and public key based on your google calendar at your end.  


document.getElementById('btn1').onclick = function () { 
    var scheduleObj = document.getElementById('schedule').ej2_instances[0]; 
    var calendarId2 = "[email protected]"; 
    var publicKey = "AIzaSyDWdn31NqttilWPnyfzqfNQhSVIxoVxQhw"; 
    var dataManager = new ej.data.DataManager({ 
        url: 'https://www.googleapis.com/calendar/v3/calendars/' + calendarId2 + '/events?key=' + publicKey, 
        adaptor: new ej.data.WebApiAdaptor(), 
        crossDomain: true 
    }); 
    scheduleObj.eventSettings.dataSource = dataManager; 
}; 


Kindly try the above solution and let us know if you need further assistance. 

Regards, 
Balasubramanian S 


Marked as answer
Loader.
Up arrow icon