Fullcalendar Disable Select Day If Is Not Allowed In Selectallow Callback
In the FullCalendar plugin, I need allow selection of days until a day or between dates. I put an example to explain better. https://codepen.io/stefanmalex/pen/Jjjjgmp I have an ar
Solution 1:
ADyson has recognized it correctly.
The program logic needs to be changed.
In the selectAllow
you were checking the array with startStr, so basically it will be checking with start date of selection only, not the whole selection.
So, if you tried to select 14 oct to 18 oct, you needed to check / compare the disallowed dates with in this range.
So, it is needed to loop through the disallowedDays array to check each date within the tried selection, like the following loop:
for(var i=0;i<disallowedDays.length;i++) {
var dd = newDate(disallowedDays[i]);
if(dd.getTime() >= startDate.getTime() && dd.getTime() <= endDate.getTime()){
returntrue;
}
}
Following this logic, check here the solution you might be expecting
Post a Comment for "Fullcalendar Disable Select Day If Is Not Allowed In Selectallow Callback"