艾有富
艾有富

Reputation: 11

In the FullCalendar, How can I add an event

I'm doing work attendance management function, an employee of the month attendance to read from the database to the FullCalendar. I need, in the absence of attendance records to date, to add a click event, identifying the content for being late or other.

Now I don't know how to add data to the events in, first.

Upvotes: 0

Views: 477

Answers (2)

Pranav
Pranav

Reputation: 206

Create a form/modal to add data in calendar and add

dayClick: function(start, end, allDay) {     
 alert();
}

or you can use

select: function(start, end, allDay) {
 alert();
}

Upvotes: 0

艾有富
艾有富

Reputation: 11

I got the solution.

var event={title: 'New Event', start:  selectDate};

$('#calendar').fullCalendar( 'renderEvent', event, true);

Upvotes: 1

Related Questions