fullcalendar / fullcalendar

Full-sized drag & drop event calendar in JavaScript
https://fullcalendar.io
MIT License
18.64k stars 3.62k forks source link

Allow selection of allDay slots when selectConstraint is businessHours #6039

Open jfelixalba opened 3 years ago

jfelixalba commented 3 years ago

Reduced Test Case

https://codesandbox.io/s/condescending-microservice-xoy5j

Bug Description

It's not able to select all day box when a selectConstraint is specified, I have tried different ways, specifying the word 'businessHours' or specifying the same business hours with the flag allDay = true.

Describe how to recreate the bug. To reproduce the bug you just need to create a calendar component with a specific business hour and with a constraint, select week view, and try to select all day and it is enable visibly, but disabled to select.

What do you expect to happen? You can select time slots that are in the business hours or all day slot.

What happens instead? You cannot select all day slot

acerix commented 3 years ago

It doesn't seem like a bug since an allDay event does not fit in the business hours, but could be useful as a new option. You could use selectAllow to do this instead of a constraint.

jfelixalba commented 3 years ago

But selectAllow function does not return if it is a business hour or non-business hour. Just start, end and all day fields are visible in the callback.

acerix commented 3 years ago

Yes, you'd need to manually compare the selection times and day of week to the business hours setting.

jfelixalba commented 3 years ago

wouldn't it be better if more details are returned? or there's a reason for not returning more info about the event/time slot info?