你應該初始化你的日曆就像下面的例子。 請參閱我的jsfiddle示例爲您的解決方案。 https://jsfiddle.net/ahmetyildirim/pk7na5jL/
它適用於Fullcalendar v3.2.0。
$(document).ready(function() {
$('#calendar').fullCalendar({
weekends: false, // will hide Saturdays and Sundays
header: {
left: 'prev,next today',
center: 'title',
right: 'agendaWeek,month,agendaDay'
},
defaultView: "agendaWeek",
businessHours: {
// days of week. an array of zero-based day of week integers (0=Sunday)
dow: [1, 2, 3, 4, 5], // Monday - Friday
start: '08:00', // a start time (8am in this example)
end: '18:00' // an end time (6pm in this example)
},
minTime: '06:30:00',
maxTime: '19:30:00',
slotDuration: '00:15:00',
slotLabelInterval: 15,
slotLabelFormat: 'h(:mm)a',
defaultDate: '2016-01-12',
slotMinutes: 15,
events: [{
title: 'test',
start: '2016-01-11T09:30:00',
end: '2016-01-11T12:30:00'
}]
});
});
你能發佈你的初始化代碼嗎? – bgmCoder
@BGM感謝您的評論,我應該發佈。我只是簡單地使用沒有編輯的樣例初始化,所以忘了輸入它。我想通了,如下所示。 – Cineno28