Overview
A date picker is a native control that lets a user select a date or time. Play's date picker element uses Apple's native iOS date picker. Date pickers can be customized according to the SwiftUI properties, and they automatically include all native functionality, like selecting dates or switching months.
Element Properties
Mode
Set if the date picker should display the date, the time, both the date & time, or a countdown timer:
Date: Allows the user to select a date (month, day, year).
Time: Allows the user to select a time (hour, minute, AM or PM)
Date & Time: Allows the user to select both a date and a time.
Count Down Timer: Allows the user to select a time to count from (hour and minute). (Only available in Wheels style)
Style
Set if the date picker's style should be compact, inline, or wheels:
Compact: Show the data in a compact view that, when tapped, will expand for user interaction.
Inline: Show the full view (i.e. for date mode, it will show a full calendar).
Wheels: Show the date or time in a wheel interface which functions the same as a native picker.
Tint Color
Select the date picker’s accent color. (Not available for Wheels style)
Expression Editor Properties
Day
DatePicker.day
Current day of the date picker.
Hour
DatePicker.hour
Current hour of the date picker.
Minute
DatePicker.minute
Current minute of the date picker.
Month
DatePicker.month
Current month of the date picker.
Second
DatePicker.second
Current second of the date picker.
Value
DatePicker.value
Current value (all data) of the date picker.
Year
DatePicker.year
Current year of the date picker.
Date pickers also have access to general object properties.
Resources
Related Triggers & Actions
Date Picker Event trigger
Links