sandeep sandeep - 4 months ago 18
PHP Question

How to add event to a date in fullcalender on clicking a date

I am using fullcalender. Presently adding event to a date by using drag option.Now I need to add event by clicking on particular date.

Is there any option?

Answer

I found this code in the documentation:

$('#calendar').fullCalendar({
    dayClick: function(date, jsEvent, view) {
        alert('Clicked on: ' + date.format());
        alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
        alert('Current view: ' + view.name);

        // change the day's background color just for fun
        $(this).css('background-color', 'red');
    }
});

Edit: The dayClick is what I believe you're looking for.