hersh
hersh

Reputation: 1183

Day click event on fullcalendar

How can I achieve a day click event on fullcalendar?

What I want to achieve is to show a day on a click event as in: to show the specific date clicked as in: the 9th or 10th of a given month based on the appropriate click event.

Upvotes: 2

Views: 3085

Answers (1)

Sam Dolan
Sam Dolan

Reputation: 32542

Check out the docs: http://arshaw.com/fullcalendar/docs/mouse/dayClick/

$('#calendar').fullCalendar({
    dayClick: function(date, allDay, jsEvent, view) {

        if (allDay) {
            alert('Clicked on the entire day: ' + date);
        }else{
            alert('Clicked on the slot: ' + date);
        }

        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');

    }
});

Upvotes: 3

Related Questions