JengaDatePicker

fun JengaDatePicker(selectedDate: LocalDate?, onSelectedDateChange: (LocalDate) -> Unit, monthTitle: (YearMonth) -> String, dayOfWeekLabel: (DayOfWeek) -> String, previousMonthContentDescription: String, nextMonthContentDescription: String, modifier: Modifier = Modifier, dateRange: ClosedRange<LocalDate>? = null, state: JengaCalendarState = rememberDefaultPickerState(selectedDate, dateRange), isSelectable: (LocalDate) -> Boolean = { true }, today: LocalDate = remember { JengaCalendarDefaults.today() }, dateContentDescription: (LocalDate) -> String = { it.toString() }, colors: JengaCalendarColors = JengaCalendarDefaults.colors(), yearPickerLabel: (YearMonth) -> String? = null)(source)

A single-date picker: a month title with previous/next buttons above a paging JengaCalendar. Every visible string comes from the caller (monthTitle, dayOfWeekLabel and the button descriptions), so it follows the app's locale.

Parameters

selectedDate

the selected date, or null for none.

onSelectedDateChange

called with a tapped date.

monthTitle

the title for a month (e.g. "March 2026").

dayOfWeekLabel

the column label for a day of the week (e.g. "Mo").

previousMonthContentDescription

accessibility label for the previous-month button.

nextMonthContentDescription

accessibility label for the next-month button.

modifier

the Modifier for the picker.

dateRange

the earliest and latest dates that can be picked; days outside it are disabled and the month buttons stop at its first and last month. With no selected date the picker opens on the month nearest today inside the range.

state

the calendar state; by default it spans dateRange, or ten years either side of the selected date (or today), and opens on the selected month.

isSelectable

whether a date can be picked.

today

the date marked as today.

dateContentDescription

accessibility label for a day cell; the ISO date by default.

colors

the color set; defaults to JengaCalendarDefaults.colors.

yearPickerLabel

when set, the month title becomes a button that swaps the days for a grid of years; this is its accessibility label for the shown month (e.g. "Choose year, October 2008"). Picking a year returns to the days on the same month in that year, without selecting a day.

Samples

var date by remember {
    mutableStateOf<LocalDate?>(
        value = null,
    )
}
JengaDatePicker(
    selectedDate = date,
    onSelectedDateChange = { date = it },
    monthTitle = { "${it.month.name} ${it.year}" },
    dayOfWeekLabel = {
        it.name.take(
            n = 2,
        )
    },
    previousMonthContentDescription = "Previous month",
    nextMonthContentDescription = "Next month",
)