How to add events to Google Calendar using FullCalendar

后端 未结 3 1296
猫巷女王i
猫巷女王i 2020-12-13 11:23

I have searched through FullCalendar documentation and googled around but I haven\'t been able to find how to add events to Google Calendar using FullCalendar. I have tried

3条回答
  •  醉酒成梦
    2020-12-13 12:23

    I had the same problem. I read many documentation, and at last I got a working Code. I share it here whith you:

    This is how to actually add an event in Google Cal from Fullcalendar (which I like very much) :

    FIRST : GET A CUSTOM FORM from FullCalendar

     $('#calendar').fullCalendar({
        set all options : options,
        selectable: true,
        selectHelper: true,
        // here is the part :
        select: function(start, end) {
                modalbox(start.format(),end.format());
        },
        editable: true
     });
    

    So, I make a modal Box when I select a time range (so that I can manage the inputs myself). I use here start.format() so that the DateTime is already in a GoogleFormat.

    SECOND : CREATE YOUR FORM

    1/ I create the form

    (in modal window). It will contain all the info for Google Calendar.

    
    
    
    

    .

    2/ I get the data and push it to a new page in AJAX

    so that the page does not reload...

    
    
                                     
                  
提交回复
热议问题