答案 0 :(得分:0)
首先,创建一个函数,该函数返回具有一年所有假日天数的对象,例如
function Holidays(y) {
var chrstimasDay = new Date(an, "11", "25")
//Add others holdays days here
return new Object([{
title: "Christmas Day's",
start: moment(chrstimasDay).format("L")
}
//Add others holdays days here
}
然后在fullcalendar中添加此来源
$("#yourDivId").fullCalendar({
//init your options....
eventSources: [
{
events: Holidays(moment().format('YYYY')),
color: "#000",
className: "Add extra classname here for customization"
}
})