FullCalendar: I cannot resize events in month mode

I get a list of events from the server with an AJAX call. I have the "editable" option set to "true", but it only works on the Day and AgendaWeek agenda, and not in month view mode. What for? This is the code:

$('#calendar').fullCalendar({
        header: {
            right: "agendaDay,agendaWeek,month prev,next"
        },
        firstDay: 1,
        fixedWeekCount: false,
        contentHeight: 700,
        timeFormat: "HH:mm",
        displayEventEnd: {
            month: false,
            agendaWeek: false,
            agendaDay: false,
            'default':true
        },
        axisFormat: "HH:mm",
        slotEventOverlap: false,
        editable: true,

        eventSources: [
            {   // 1st group: Miscellanea
                events: function(start,end,timezone,callback){

                    callAjax("Miscellanea",callback);
                },
                color: "#086A87",

            },{ // 2nd group: project init
                events: function(start,end,timezone,callback){

                    callAjax("Project",callback);
                },
                color: "#B40404"
            }
        ]
});

And this is my callAjax function:

function callAjax(type,callback){

    $.ajax({
        type: "GET",
        url: "/projects/{{project.id}}/get_events/",
        dataType: "json",
        data: {"data":type},
        success: function(response){
            data = eval("(" + response + ")")

            var events = [];

            for(i=0;i<data.length;i++){

                events.push({
                    id: data[i].pk,
                    title: data[i].fields['title'],
                    start: data[i].fields['start'],
                    end: data[i].fields['end'],
                    className: "event",
                    defaultTimedEventDuration: "00:30:00"
                });
            }
            callback(events);
        }
    });

}

As I said, everything works fine, except for the monthly resizing, and I can’t imagine what the problem is. Help?

+4
source share
4 answers

, "allday". "allday", , . , allday. allday . AJAX- :

function callAjax(type,callback){
    $.ajax({
        type: "GET",
        url: "/projects/{{project.id}}/get_events/",
        dataType: "json",
        data: {"data":type},
        success: function(response){
            data = eval("(" + response + ")")

            var events = [];

            for(i=0;i<data.length;i++){

                if(!data[i].fields['allday']){
                    events.push({
                        id: data[i].pk,
                        title: data[i].fields['title'],
                        start: data[i].fields['start'],
                        end: data[i].fields['end'],
                        className: "event",
                        defaultTimedEventDuration: "00:30:00"
                    });
                }else{
                    events.push({
                        id: data[i].pk,
                        title: data[i].fields['title'],
                        start: data[i].fields['start'],
                        end: data[i].fields['end'],
                        allDay: true,
                        className: "event",
                        defaultTimedEventDuration: "00:30:00"
                    });
                }
            }

            callback(events);
        }
    });
}

"Allday" 0:00:00 . . "" . , .

+5

, , start end , , :

{
    title: 'Resizable',
    start: '2015-02-11',
    end: '2015-02-13'
},
{
    title: 'Not resizable',
    start: '2015-02-12T10:30:00',
    end: '2015-02-12T12:30:00'
},

.

+2

, allDay. , "" . "NULL" "0" "0" "1" allDay, .

0

-

editable : true, .

fullcalendar demo, allDay: true, editable : true.

{
    title: 'Your Event',
    start: new Date(y, m, d - 5),
    end: new Date(y, m, d - 2),
    allDay: true, // optional
    editable : true
}
0

All Articles