首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >整日历现在()指示器定位错误

整日历现在()指示器定位错误
EN

Stack Overflow用户
提问于 2019-03-13 12:23:23
回答 2查看 1.9K关注 0票数 2

在完整日历中,当设置参数时

分钟时间

最大时间

Now()指示符没有正确定位。

我有一个JSFiddle来展示这个问题。在这个Fiddle中,我希望指标在当前日期和时间,但它位于“昨天”栏的顶部。

下面是小提琴中使用的代码

代码语言:javascript
复制
<div id="calendar"></div>

Javascript

代码语言: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

参数,使当前指示符位置正确,如下面所示:https://jsfiddle.net/8jndrp7m/2/

在使用minTime和maxTime时,如何正确定位Now指示器?还是这是个窃听器?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-03-13 12:43:45

问题就像您为第二天设置了maxTime,这是为什么它不能工作的原因。

如果您喜欢指定日期以设置最大值,请使用validRange设置min & max日期

代码语言:javascript
复制
$('#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
    })
票数 0
EN

Stack Overflow用户

发布于 2019-03-13 12:33:50

我看到了许多问题:

  1. 现在的指示器不需要引号,将'true'改为true
  2. 如果你想延长午夜后的最大时间,你可以把一个1.放在时间的前面,来设置第二天早上下一个day.So 8的时间是maxTime: '1.08:00:00'
  3. 如果你在晚上8点开始日历,而不是晚上8点(至少在我的时区),现在的指示器将无法正确显示。
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55141826

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档