From 85adb2be69249029744c3913e304b2eaf5dfad8f Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 14 May 2024 16:43:49 -0500 Subject: [PATCH] fixed bug for seelcted date Signed-off-by: Matt Bruce --- VDS/Components/DatePicker/DatePickerCalendarModel.swift | 6 ------ VDS/Components/DatePicker/DatePickerViewController.swift | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/VDS/Components/DatePicker/DatePickerCalendarModel.swift b/VDS/Components/DatePicker/DatePickerCalendarModel.swift index b9b8c8f7..ccceb5c9 100644 --- a/VDS/Components/DatePicker/DatePickerCalendarModel.swift +++ b/VDS/Components/DatePicker/DatePickerCalendarModel.swift @@ -32,17 +32,12 @@ extension DatePicker { /// If provided, the calendar will allow a selection to be made up to this date. public let maxDate: Date - /// If provided, this is the date that will show as selected by the Calendar. - /// If no value is provided, the current date will be used. If null is provided, no date will be selected. - public let selectedDate: Date - /// Array of ``CalendarIndicatorModel`` you are wanting to show on legend. public let indicators: [CalendarBase.CalendarIndicatorModel] public init(surface: Surface = .light, hideContainerBorder: Bool = false, hideCurrentDateIndicator: Bool = false, - selectedDate: Date = Date(), activeDates: [Date] = [], inactiveDates: [Date] = [], minDate: Date = Date().startOfMonth, @@ -51,7 +46,6 @@ extension DatePicker { self.surface = surface self.hideContainerBorder = hideContainerBorder self.hideCurrentDateIndicator = hideCurrentDateIndicator - self.selectedDate = selectedDate self.activeDates = activeDates self.inactiveDates = inactiveDates self.minDate = minDate diff --git a/VDS/Components/DatePicker/DatePickerViewController.swift b/VDS/Components/DatePicker/DatePickerViewController.swift index 165dab75..f8a6e2f0 100644 --- a/VDS/Components/DatePicker/DatePickerViewController.swift +++ b/VDS/Components/DatePicker/DatePickerViewController.swift @@ -49,7 +49,7 @@ extension DatePicker { picker.indicators = calendarModel.indicators picker.activeDates = calendarModel.activeDates picker.inactiveDates = calendarModel.inactiveDates - picker.selectedDate = calendarModel.selectedDate + picker.selectedDate = selectedDate picker.minDate = calendarModel.minDate picker.maxDate = calendarModel.maxDate picker.pinToSuperView(.init(top: topPadding, left: padding, bottom: padding, right: padding))