首先,请原谅我的英语,我来自墨西哥。
我的问题是这个...
我有这个代码:
$('#calendar').fullCalendar({
defaultView: 'agendaDay',
businessHours: false, // to enable all 24 hours regardless of the businessHours per resource
weekends: true, // to allow navigation between weekend days
resources: [
{ id:1, title: "Employe 1", businessHours: { start:"08:00:00", end:"12:00:00" } },
{ id:2, title: "Employe 2" }
]
});
如您所见,我在议程日模式下使用 fullcalendar 的日程安排插件(垂直的时间轴槽),我所做的是声明 2 个资源,一个有 businessHours,另一个没有 businessHours。这里的问题(我不知道这是不是一个错误)是在周末的导航中。查看非周末日没问题,但查看周末时资源时间线被禁用就好像这些没有 businessHours 一样,但这只发生在具有 businessHours 的资源(那些没有这个属性的资源工作正常),STILL 当全局的 businessHours 属性设置为 false (正如你在初始化中看到的那样)。所以,问题是,我需要为每个人显示带有 businessHours 的资源,因为对我来说,资源是一名员工,每个人都可以有不同的时间表,并且每天可以有更多的员工,那是因为我需要管理一个 businessHour每个资源而不是全局。请一些帮助?
问候!
似乎默认情况下,如果您只给出营业时间的时间而不设置星期几,那么 fullCalendar 会假定您只表示周一到周五。
默认营业时间(如果根本没有指定)是周一至周五 09:00-17:00。看起来通过指定您自己的时间,您只会覆盖时间,而不会覆盖天数。
简单的解决方案是明确指定一周中的所有天数:
resources: [
{ id:1, title: "Employee 1", businessHours: { dow: [ 0, 1, 2, 3, 4, 5, 6 ], start:"08:00:00", end:"12:00:00" } },
{ id:2, title: "Employee 2" }
]
该dow
参数采用一组数字表示一周中的天数 o 以启用营业时间,其中 0 = 星期日,1 = 星期一等,直到 6 = 星期六。
有关更多详细信息,请参阅https://fullcalendar.io/docs/display/businessHours/。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句