fun DatePicker(title: String, selection: Double, modifier: Modifier = Modifier, displayedComponents: DatePickerComponents? = null, onSelectionChange: (Double) -> Unit)Overview
Dates are passed as seconds since 1970, as Double.
DatePicker(title = "…", selection = 0.0, onSelectionChange = { value -> })This is the Kotlin form of SwiftUI DatePicker.init(_:selection:displayedComponents:): SwiftUI documentation. In Swift it reads:
nonisolated init<S>(_ title: S, selection: Binding<Date>, displayedComponents: DatePicker<Label>.Components = [.hourAndMinute, .date]) where S : StringProtocolTopics
Creating a DatePicker
fun DatePicker(selection: Double, modifier: Modifier = Modifier, displayedComponents: DatePickerComponents? = null, onSelectionChange: (Double) -> Unit, content: @Composable () -> Unit)
fun DatePicker(title: String, selection: Double, modifier: Modifier = Modifier, displayedComponents: DatePickerComponents? = null, onSelectionChange: (Double) -> Unit)
fun DatePicker(titleResource: LocalizedKey, selection: Double, modifier: Modifier = Modifier, displayedComponents: DatePickerComponents? = null, onSelectionChange: (Double) -> Unit)
fun DatePicker(titleKey: LocalizedKey? = null, selection: Double? = null, displayedComponents: DatePickerComponents? = null, modifier: Modifier = Modifier, onSelectionChange: ((Double) -> Unit)? = null)
Methods
fun DatePickerSelection(titleKey: LocalizedKey, selection: Double, modifier: Modifier = Modifier, displayedComponents: DatePickerComponents? = null, onSelectionChange: (Double) -> Unit)