//fullCalendar3.0以后的版本
$('#calendar').fullCalendar({
customButtons: {
myCustomButton: {
text: '自定义按钮', click: function () {
alert('点击了自定义按钮!');
}
}
},
header: {
left: 'prev,next today myCustomButton',
center: 'title',
right: 'month,agendaWeek,agendaDay'}
});
//3.0以前的版本
$('.fc-toolbar .fc-right').prepend(
$('<button type="button" class="fc-button fc-state-default fc-corner-left fc-corner-right">登陆日程</button>')
.on('click', function() {
var title = prompt('登录日程');
if (title) {
$('#calendar').fullCalendar(
'addResource',
{ title: title },
true
);
}
})
);