react-native-calendar-kit icon indicating copy to clipboard operation
react-native-calendar-kit copied to clipboard

Unavailable hours for Resource calendar mode

Open sandeepsuthar opened this issue 1 year ago • 5 comments

Need unavailable hours customisation for Resource Calendar mode, like one resource not able at specific time or all day.

sandeepsuthar avatar Nov 26 '24 08:11 sandeepsuthar

bump, any updates if this is gonna get implemented soon?

BeelzeBut avatar Feb 23 '25 16:02 BeelzeBut

The same issue

VikBn avatar Feb 27 '25 10:02 VikBn

Any update on this? Having custom unavailableHours per resource would be a big plus in enabling multiple locations with different work schedules or multiple people to manage with different work schedules.

BeelzeBut avatar Aug 28 '25 08:08 BeelzeBut

If I understand correctly, this seems to be fixed now.

You can add a resourceId to the unavailableHours items. That way each unavailableHours item can be for an individual resource just like the events.

mrzachnugent avatar Sep 03 '25 16:09 mrzachnugent

If I understand correctly, this seems to be fixed now.

You can add a resourceId to the unavailableHours items. That way each unavailableHours item can be for an individual resource just like the events.

No adding a resourceId to the unavailableHours items won't work. Looking at UnavailableHoursProvider.tsx line 42-> 45 and line 67->74 to see how it handles the unavailableHours props:

 // line 42->45
      let originalData: Record<string, UnavailableHourProps[]> = {};
      if (Array.isArray(unavailableHours)) {
        originalData = {
          '1': unavailableHours,
          '2': unavailableHours,
          '3': unavailableHours,
          '4': unavailableHours,
          '5': unavailableHours,
          '6': unavailableHours,
          '7': unavailableHours,
        };
      } else {
        originalData = unavailableHours;
      }

// line 67->74
        const forceDate = forceUpdateZone(startDateTime, timeZone);
        const dateUnix = forceDate.toMillis();
        const weekDay = forceDate.weekday;
        const dateStr = forceDate.toFormat('yyyy-MM-dd');
        const unavailableHoursByDate = originalData[dateStr] || originalData[weekDay];

From this, you can see the logic only supports handling unavailable hours by specific dates (yyyy-MM-dd) or weekdays (1–7). It doesn’t account for resource-level filtering.

samthui avatar Sep 14 '25 13:09 samthui