JengaDateOfBirthPicker

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.

onValueChange

called with the new date once a wheel settles.

monthLabel

the label for a month (e.g. "March").

modifier

the Modifier for the picker.

minDate

the earliest selectable date.

maxDate

the latest selectable date; today by default.

order

the order of the wheels; see JengaDateFieldOrder.

dayContentDescription

accessibility label for the day wheel.

monthContentDescription

accessibility label for the month wheel.

yearContentDescription

accessibility label for the year wheel.

visibleItemCount

the number of rows visible on each wheel.

itemHeight

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 },
)