Get selected date from fullcalendar

后端 未结 2 1191
情歌与酒
情歌与酒 2021-02-06 14:54

I added the calendar to my asp.net mvc 2 application from here .

I want to pick the selected date where I am going to enter the event. How can I get selected date?

2条回答
  •  时光说笑
    2021-02-06 15:13

    $('#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');
    
        }
    });
    

提交回复
热议问题