diff --git a/src/selection/useRange.tsx b/src/selection/useRange.tsx index f95161fc2..97acd68bb 100644 --- a/src/selection/useRange.tsx +++ b/src/selection/useRange.tsx @@ -45,8 +45,11 @@ export function useRange( if (newRange?.from && newRange.to) { let newDate = newRange.from; - while (dateLib.differenceInCalendarDays(newRange.to, newDate) > 0) { + const totalDays = dateLib.differenceInCalendarDays(newRange.to, newDate); + + for (let i = 0; i < totalDays; i++) { newDate = dateLib.addDays(newDate, 1); + if ( excludeDisabled && disabled &&