fullcalendarfullcalendar-scheduler

Fullcalendar individual resource slotDuration


Using FullCalendar.io does anyone know if it's possible to customise the slotDuration based on the resource (similar to businessHours)? I'm using a "resourceTimeGridDay" with multiple resources (one per vertical column). My issue is some resources require 15 minutes, others 30 minutes. I've searched for hours and am amazed I find nothing related.

Any brilliant ideas?

EDITED: Ok, if this isn't possible, how can I restrict the selections (where the user selects an empty space in the timetable). eg. The calendar displays 15 minute durations, column A all at 15 no worries. Column B however needs a 60 minute duration, starting on the hour only. So if a user selects 4:15PM in column B I actually need from 4PM to 5PM to be selected.

Is this possible?

Thanks.


Solution

  • You can't do that unfortunately. You must just use the smallest duration you require, and you have to apply it across the whole calendar.

    To restrict the selection length on a per-resource basis, one approach would be to handle selectAllow (fullcalendar.io/docs/selectAllow) and use the info provided to decide whether the selection's time period is large enough, for the resource where the selection is being made.