First of all, excuse me for my english, I'm from México.
My problem is this...
I have this code:
$('#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" }
]
});
As you can see, I'm using fullcalendar's schedule plugin in agendaDay mode (timeline slot in vertical), and what I do is declaring 2 resources, one with businessHours and other without businessHours. The problem here (I don't know if it's a bug) is in navigation in weekend days. When viewing no-weekend days no problem, but when weekend days are viewed the resources timeline are disabled as if these was without businessHours, BUT that happens only for resources with businessHours (those that don't have this property works fine), STILL when globally the businessHours property is set to false (as you can see in the initializacion). So, the problem is that, I need show resources with businessHours for each, because for my a resource is an employe and each one can has different schedule and can there are more that one employe by day, and that's because I need manage a businessHour per-resource and not globally. Some help please?
Regards!
It seems that, by default, if you just give times for your business hours and don't set days of the week, then fullCalendar assumes that you meant only Monday to Friday.
The default business hours, if not specified at all, are Monday-Friday 09:00-17:00. It looks like by specifying your own hours, you overwrite only the times, but not the days.
The simple solution is to explicitly specify all the days of the week:
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" }
]
The dow
parameter takes an array of numbers signifying the days of the week o which to enable the business hours, where 0 = Sunday, 1 = Monday etc. through to 6 = Saturday.
See https://fullcalendar.io/docs/display/businessHours/ for more details.