我使用全日历制作了7天的时间表日历。但不是时间,我只需要约会。我不需要时间。我只想要12/18 12/19 12/20等日期。这是我的代码:
$(function() { // document ready
$('#calendar').fullCalendar({
now: '2017-12-07',
editable: false, // enable draggable events
aspectRatio: 1.9,
scrollTime: '00:00', // undo default 6am scrollTime
header: {
left: 'prev,next',
center: 'title',
right: 'timelineThreeDays'
},
defaultView: 'timelineThreeDays',
views: {
timelineThreeDays: {
type: 'timeline',
duration: { days: 7 }
}
},
resourceLabelText: 'Inventory',
resources: [
{ id: 'a', title: 'Auditorium A' },
{ id: 'b', title: 'Auditorium B', eventColor: 'green' },
{ id: 'c', title: 'Auditorium C', eventColor: 'orange' },
{ id: 'd', title: 'Auditorium D', children: [
//{ id: 'd1', title: 'Room D1' },
//{ id: 'd2', title: 'Room D2' }
] },
{ id: 'e', title: 'Auditorium E' },
{ id: 'f', title: 'Auditorium F', eventColor: 'red' },
{ id: 'g', title: 'Auditorium G' },
{ id: 'h', title: 'Auditorium H' },
{ id: 'i', title: 'Auditorium I' },
{ id: 'j', title: 'Auditorium J' },
{ id: 'k', title: 'Auditorium K' },
{ id: 'l', title: 'Auditorium L' },
{ id: 'm', title: 'Auditorium M' },
{ id: 'n', title: 'Auditorium N' },
{ id: 'o', title: 'Auditorium O' },
{ id: 'p', title: 'Auditorium P' },
{ id: 'q', title: 'Auditorium Q' },
{ id: 'r', title: 'Auditorium R' },
{ id: 's', title: 'Auditorium S' },
{ id: 't', title: 'Auditorium T' },
{ id: 'u', title: 'Auditorium U' },
{ id: 'v', title: 'Auditorium V' },
{ id: 'w', title: 'Auditorium W' },
{ id: 'x', title: 'Auditorium X' },
{ id: 'y', title: 'Auditorium Y' },
{ id: 'z', title: 'Auditorium Z' }
],
events: [
//{ id: '1', resourceId: 'b', start: '2017-12-07T02:00:00', end: '2017-12-07T07:00:00', title: 'event 1' },
//{ id: '2', resourceId: 'c', start: '2017-12-07T05:00:00', end: '2017-12-07T22:00:00', title: 'event 2' },
{ id: '3', resourceId: 'b', start: '2017-12-07', end: '2017-12-12', title: 'Hold' },
{ id: '4', resourceId: 'd', start: '2017-12-07', end: '2017-12-10', title: 'Available' },
//{ id: '4', resourceId: 'e', start: '2017-12-07T03:00:00', end: '2017-12-07T08:00:00', title: 'event 4' },
//{ id: '5', resourceId: 'f', start: '2017-12-07T00:30:00', end: '2017-12-07T02:30:00', title: 'event 5' }
]
});
});
如果我删除scrollTime没有运气。任何人都可以知道如何实现这一目标?
我想你的意思是你希望时间线上显示的时间间隔是整天,而不是几小时或几分钟的较短间隔。
为此,根据文档,您必须设置“slotDuration”选项:
slotDuration: '24:00'
让你显示24小时(1天)的间隔。
有关演示,请参阅http://jsfiddle.net/toytd26b/3/。