Structure
DatePickerConfiguration
public struct DatePickerConfiguration
A configuration object for setting up a DatePicker.
Initializers
init(startDate:endDate:startAtDate:previouslySelectedDate:allowsMultipleSelection:useRangeSelection:)
public init(startDate: Date = Date(), endDate: Date = Date.distantFuture,
startAtDate: Date = Date(), previouslySelectedDate: Date? = nil,
allowsMultipleSelection: Bool = false, useRangeSelection: Bool = false)
Creates a config for a DatePicker
Parameters
Name | Type | Description |
---|---|---|
startDate | Date |
The start boundary. Defaults to today. You can pass Data.distantPast or a specific date if you need to allow a user to select a date in the past. |
endDate | Date |
The end boundary. Defaults to the distant future. |
startAtDate | Date |
The date that the calendar should currently be viewing. This is useful if you want to allow selection of a previous date, but want to start the user at todays date. Defaults to today. |
allowsMultipleSelection | Bool |
If true, allow the user to select multiple dates. Defaults to false. |
useRangeSelection | Bool |
If true, allowsMultipleSelection must also be true. Allows the user to select a range of dates. Defaults to false. |