Fullcalendar Now() 指标定位错误
Fullcalendar Now() Indicator positioned wrongly
在全日历中,设置参数时
mintime
和
maxtime
Now() 指示器位置不正确。
我有一个 JSFiddle 来说明这个问题。
在此 Fiddle 中,我希望指标处于当前日期和时间,但它位于 "yesterday"
列的顶部
下面是fiddle
中使用的代码
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'
})
删除
minTime
和
maxTime
parameters, 使 Now 指示器位置正确,如下所示
https://jsfiddle.net/8jndrp7m/2/
如何在使用 minTime 和 maxTime 时正确定位 Now 指示器?
或者这是一个错误?
我看到多个问题:
- 现在的指标不需要报价,将
'true'
改为true
,
- 如果你想将最长时间延长到午夜之后,你可以在时间前面放一个
1.
,设置下一个 day.So 第二天早上 8 点的时间将是 maxTime: '1.08:00:00'
- 如果你在晚上 8 点开始日历,但现在还不到晚上 8 点(至少在我的时区是这样),现在指示器将无法正确显示
问题看起来是你为第二天设置了 maxTime,这就是为什么它不起作用
如果您想指定日期来设置最大值,请使用 validRange 来设置最小和最大日期
$('#calendar').fullCalendar({
defaultView: 'agendaWeek', //agendaWeek
validRange: {
start: '2017-05-01',
end: '2017-06-01'
},
locale: 'nl',
timezone: 'local',
themeSystem: 'bootstrap3',
height: 600,
slotDuration: '00:10:00',
nowIndicator: 'true',
minTime: "17:00:00", // this makes the calendar start at 8PM
maxTime: "20:00:00", // this makes the calender end 24 hours later at 8PM ( (8PM => 20) + 24 = 44)
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
editable: true, // enable draggable events
droppable: true, // this allows things to be dropped onto the calendar
})
在全日历中,设置参数时
mintime
和
maxtime
Now() 指示器位置不正确。
我有一个 JSFiddle 来说明这个问题。 在此 Fiddle 中,我希望指标处于当前日期和时间,但它位于 "yesterday"
列的顶部下面是fiddle
中使用的代码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'
})
删除
minTime
和
maxTime
parameters, 使 Now 指示器位置正确,如下所示 https://jsfiddle.net/8jndrp7m/2/
如何在使用 minTime 和 maxTime 时正确定位 Now 指示器? 或者这是一个错误?
我看到多个问题:
- 现在的指标不需要报价,将
'true'
改为true
, - 如果你想将最长时间延长到午夜之后,你可以在时间前面放一个
1.
,设置下一个 day.So 第二天早上 8 点的时间将是maxTime: '1.08:00:00'
- 如果你在晚上 8 点开始日历,但现在还不到晚上 8 点(至少在我的时区是这样),现在指示器将无法正确显示
问题看起来是你为第二天设置了 maxTime,这就是为什么它不起作用
如果您想指定日期来设置最大值,请使用 validRange 来设置最小和最大日期
$('#calendar').fullCalendar({
defaultView: 'agendaWeek', //agendaWeek
validRange: {
start: '2017-05-01',
end: '2017-06-01'
},
locale: 'nl',
timezone: 'local',
themeSystem: 'bootstrap3',
height: 600,
slotDuration: '00:10:00',
nowIndicator: 'true',
minTime: "17:00:00", // this makes the calendar start at 8PM
maxTime: "20:00:00", // this makes the calender end 24 hours later at 8PM ( (8PM => 20) + 24 = 44)
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
editable: true, // enable draggable events
droppable: true, // this allows things to be dropped onto the calendar
})