 
     func checkScrollToPreviousDisabled() {
         let calendar = self.calendarView.delegate?.calendar?() ?? Calendar.current
-        if let presentedMonth = monthViews[presented],
-            let disableScrollingBeyondDate = calendarView.disableScrollingBeyondDate {
-            let convertedDate = CVDate(date: disableScrollingBeyondDate, calendar: calendar)
-            presentedMonth.mapDayViews({ dayView in
-                if matchedDays(convertedDate, dayView.date) {
-                    presentedMonth.allowScrollToPreviousMonth = false
-                }
-            })
-        }
+
+        guard let presentedMonth = monthViews[presented],
+            let disableScrollingBeforeDate = calendarView.disableScrollingBeforeDate else {
+                return
+        }
+
+        let convertedDate = CVDate(date: disableScrollingBeforeDate, calendar: calendar)
+        presentedMonth.mapDayViews({ dayView in
+            if matchedDays(convertedDate, dayView.date) {
+                presentedMonth.allowScrollToPreviousMonth = false
+            }
+        })
+    }
+
+    func checkScrollToBeyondDisabled() {
+        let calendar = self.calendarView.delegate?.calendar?() ?? Calendar.current
+
+        guard let presentedMonth = monthViews[presented],
+            let disableScrollingBeyondDate = calendarView.disableScrollingBeyondDate else {
+                return
+        }
+
+        let convertedDate = CVDate(date: disableScrollingBeyondDate, calendar: calendar)
+        presentedMonth.mapDayViews({ dayView in
+            if matchedDays(convertedDate, dayView.date) {
+                presentedMonth.allowScrollToNextMonth = false
+            }
+        })
     }
 }
 

        monthViews[identifier] = monthView
        scrollView.addSubview(monthView)
        checkScrollToPreviousDisabled()
        calendarView.coordinator?.disableDays(in: presentedMonthView)
    }


        }

        checkScrollToPreviousDisabled()
        checkScrollToBeyondDisabled()

        calendarView.presentedDate = CVDate(date: presentedMonthView.date, calendar: calendar)
    }
