javascript - Fullcalendar Now() 指标定位错误
问题描述
在 Fullcalendar 中,设置参数时
分钟时间
和
最大时间
Now() 指标未正确定位。
我有一个JSFiddle来显示这个问题。在这个小提琴中,我希望指标处于当前日期和时间,但它位于“昨天”列的顶部
下面是小提琴中使用的代码
HTML
<div id="calendar"></div>
Javascript
$('#calendar').fullCalendar({
defaultView: 'agendaWeek',
height: 600,
nowIndicator: 'true',
minTime: "20:00:00", // this makes the calendar start at 8PM
maxTime: "44:00:00", // this makes the calender end 24 hours later at 8PM ( (8PM => 20) + 24 = 44)
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives'
})
删除
最小时间
和
最大时间
参数,使 Now 指标位置正确,如此处所示 https://jsfiddle.net/8jndrp7m/2/
使用 minTime 和 maxTime 时如何正确定位 Now 指示器?或者这是一个错误?
解决方案
i see multiple problems:
- the now indicator doesn't need quotes, change
'true'
totrue
, - If you want to extend the maxtime past midnight you can just put a
1.
in front of the time, to set times the next day.So 8 in the morning on next day would bemaxTime: '1.08:00:00'
- If you start the calendar at 8 in the evening and its not 8pm yet (at least in my timezone) the now indicator will not show properly
推荐阅读
- python - 无法停止在 Pika 中消费
- sql - 从查询中获取列名,单引号问题
- python - 文件创建者将文件夹名称识别为现有文件
- google-bigquery - 有没有办法增加 BigQuery 中查询的分配内存?
- angular - 效果只需在 Rxjs 6 中使用两个 Observable 调用一次
- r - 查找向量中的元素序列
- c - 在 C 中反转 2 的幂的最快方法是什么?
- swift - 如何根据信标的接近程度刷新背景图像?
- python-docx - 通过python在docx.zip的word文件夹中创建footer.xml文件,在word docx中创建页脚?
- ms-access - 用于添加新表行并分配主键的表单按钮