使用minTime和maxTime时,jQuery fullcalendar在日历的末尾添加了奇怪的小时 [英] jQuery fullcalendar adds weird hr at the end of the calendar when using minTime and maxTime
问题描述
这就是我所说的:
这是我所期望的:
This is what I'm talking about: And this is what I expect:
复制这个最小设置是:
The minimal settings to replicate this are:
$('#calendar').fullCalendar({
defaultView: 'agendaWeek',
minTime: '10:00',
maxTime: '16:00'
});
你可以在 this jsbin 。
删除 minTime
或 maxTime
使得日历的行为与预期一致。
Removing either minTime
or maxTime
makes the calendar behave as expected.
推荐答案
经过一番捣鼓之后,似乎默认的宽高比是 1.35
。由于您的日历不符合该比例,因此会添加填充。
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)修改宽高比。在你的例子中, 2.2
的比例可能有效:
(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)设置 height 为 auto
。这将使日历成为自然的高度,但它不会允许滚动条:
(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'
});
这篇关于使用minTime和maxTime时,jQuery fullcalendar在日历的末尾添加了奇怪的小时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!