问题
This is what I'm talking about:


The minimal settings to replicate this are:
$('#calendar').fullCalendar({
defaultView: 'agendaWeek',
minTime: '10:00',
maxTime: '16:00'
});
You can play with it in this jsbin.
Removing either minTime
or maxTime
makes the calendar behave as expected.
回答1:
After some fiddling, it appears that the default aspect ratio is 1.35
. Because your calendar doesn't meet that ratio, it is adding padding.
There are 2 options that I can see that would fix it.
(1) Modify the aspect ratio. In your example a ratio of 2.2
might work:
$('#calendar').fullCalendar({
defaultView: 'agendaWeek',
allDaySlot: false,
minTime: '10:00',
maxTime: '16:00',
aspectRatio: 2.2
});
(2) Set height to auto
. This will make the calendar the natural height, but it will not allow for scrollbars:
$('#calendar').fullCalendar({
defaultView: 'agendaWeek',
allDaySlot: false,
minTime: '10:00',
maxTime: '16:00',
height: 'auto'
});
来源:https://stackoverflow.com/questions/28048236/jquery-fullcalendar-adds-weird-hr-at-the-end-of-the-calendar-when-using-mintime