diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e7d46e..41d4eaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added support for disabling touch handling on SwiftUI views via the `allowsHitTesting` modifier - Added SwiftUI documentation to the README.md +- Added properties to `CalendarViewProxy` for getting the `visibleMonthRange` and `visibleDayRange` ### Fixed - Fixed an issue that could cause accessibility focus to shift unexpectedly diff --git a/Sources/Public/CalendarViewProxy.swift b/Sources/Public/CalendarViewProxy.swift index f30f8fb..0831c6b 100644 --- a/Sources/Public/CalendarViewProxy.swift +++ b/Sources/Public/CalendarViewProxy.swift @@ -26,6 +26,16 @@ public final class CalendarViewProxy: ObservableObject { // MARK: Public + /// The range of months that are partially or fully visible. + public var visibleMonthRange: MonthComponentsRange? { + calendarView.visibleMonthRange + } + + /// The range of months that are partially or fully visible. + public var visibleDayRange: DayComponentsRange? { + calendarView.visibleDayRange + } + /// Scrolls the calendar to the specified month with the specified position. /// /// If the calendar has a non-zero frame, this function will scroll to the specified month immediately. Otherwise the scroll-to-month