diff --git a/VDS/Components/DatePicker/DatePickerCalendarModel.swift b/VDS/Components/DatePicker/DatePickerCalendarModel.swift index 16a46e61..da18ab2f 100644 --- a/VDS/Components/DatePicker/DatePickerCalendarModel.swift +++ b/VDS/Components/DatePicker/DatePickerCalendarModel.swift @@ -24,6 +24,8 @@ extension DatePicker { /// All other dates will be active. public let inactiveDates: [Date] + public let selectedDate: Date + /// If provided, the calendar will allow a selection to be made from this date forward. Defaults to today. public let minDate: Date @@ -37,13 +39,15 @@ extension DatePicker { hideCurrentDateIndicator: Bool = false, activeDates: [Date] = [], inactiveDates: [Date] = [], - minDate: Date = Date().startOfMonth, - maxDate: Date = Date().endOfMonth, + selectedDate: Date = Date(), + minDate: Date = Date(), + maxDate: Date = Calendar.current.date(byAdding: .year, value: 10, to: Date())!, indicators: [CalendarBase.CalendarIndicatorModel] = []) { self.hideContainerBorder = hideContainerBorder self.hideCurrentDateIndicator = hideCurrentDateIndicator self.activeDates = activeDates self.inactiveDates = inactiveDates + self.selectedDate = selectedDate self.minDate = minDate self.maxDate = maxDate self.indicators = indicators