Jenga Date Of Birth Picker
fun JengaDateOfBirthPicker(value: LocalDate, onValueChange: (LocalDate) -> Unit, monthLabel: (Month) -> String, modifier: Modifier = Modifier, minDate: LocalDate = JengaDateOfBirthPickerDefaults.MinDate, maxDate: LocalDate = remember { JengaCalendarDefaults.today() }, order: JengaDateFieldOrder = JengaDateFieldOrder.DayMonthYear, dayContentDescription: String? = null, monthContentDescription: String? = null, yearContentDescription: String? = null, visibleItemCount: Int = JengaWheelPickerDefaults.VisibleItemCount, itemHeight: Dp = JengaWheelPickerDefaults.ItemHeight, colors: JengaWheelPickerColors = JengaWheelPickerDefaults.colors())(source)
A date-of-birth picker: day, month and year scroll wheels side by side. The day is kept valid as the month or year changes (31 March becomes 28 or 29 February), and the date never leaves minDate..maxDate.
Parameters
value
the selected date.
on Value Change
called with the new date once a wheel settles.
month Label
the label for a month (e.g. "March").
modifier
the Modifier for the picker.
min Date
the earliest selectable date.
max Date
the latest selectable date; today by default.
order
the order of the wheels; see JengaDateFieldOrder.
day Content Description
accessibility label for the day wheel.
month Content Description
accessibility label for the month wheel.
year Content Description
accessibility label for the year wheel.
visible Item Count
the number of rows visible on each wheel.
item Height
the height of each row.
colors
the wheel color set; defaults to JengaWheelPickerDefaults.colors.
Samples
var birthday by remember {
mutableStateOf(
value = LocalDate(
year = 1990,
month = 3,
day = 14,
),
)
}
JengaDateOfBirthPicker(
value = birthday,
onValueChange = { birthday = it },
monthLabel = { it.name },
)Content copied to clipboard