数据之 events(数组) – FullCalendar 中文文档
2014-02-16 · 216 chars · 2 min read
日程变将要显示的 Event Object 的数组:
$('#calendar').fullCalendar({
events: [
{
title: 'event1',
start: '2010-01-01',
},
{
title: 'event2',
start: '2010-01-05',
end: '2010-01-07',
},
{
title: 'event3',
start: '2010-01-09 12:30:00',
allDay: false, // will make the time show
},
],
})
注意数组里最后一个元素后不要加逗号,否则 IE 会报错。
1.5 版本以后,可以使用 Event Source options ,当你用 eventSources 设置多个数据源的时候会很便利,不同的数据源可以有不同的设置。
$('#calendar').fullCalendar({
eventSources: [
// your event source
{
events: [
// put the array in the `events` property
{
title: 'event1',
start: '2010-01-01',
},
{
title: 'event2',
start: '2010-01-05',
end: '2010-01-07',
},
{
title: 'event3',
start: '2010-01-09 12:30:00',
},
],
color: 'black', // an option!
textColor: 'yellow', // an option!
},
// any other event sources...
],
})
官方英文文档:http://arshaw.com/fullcalendar/docs/event_data/events_array/


