资源的 businessHours 在 agendaDay 视图中周末不工作

Resource's businessHours is not working on weekends in agendaDay view

首先,请原谅我的英语不好,我来自墨西哥。

我的问题是...

我有这个代码:

$('#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" }
    ]
});

如您所见,我在 agendaDay 模式(垂直时间轴槽)中使用 fullcalendar 的日程插件,我所做的是声明 2 个资源,一个有 businessHours,另一个没有 businessHours。这里的问题(不知道是不是bug)出在周末的导航上。查看非周末日时没有问题,但是当查看周末日时,资源时间线被禁用,就好像这些时间线没有 businessHours 一样,但这只发生在有 businessHours 的资源(那些没有t have this 属性 works fine), STILL when global businessHours 属性 set to false (as you can see in the initializacion).所以,问题是,我需要为每个人显示带有 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 参数采用一个数字数组,表示一周中的哪几天启用营业时间,其中 0 = 星期日,1 = 星期一等到 6 = 星期六。

有关详细信息,请参阅 https://fullcalendar.io/docs/display/businessHours/