JengaDatePickerDialog

fun JengaDatePickerDialog(onDismissRequest: () -> Unit, onConfirm: (LocalDate) -> Unit, confirmLabel: String, dismissLabel: String, monthTitle: (YearMonth) -> String, dayOfWeekLabel: (DayOfWeek) -> String, previousMonthContentDescription: String, nextMonthContentDescription: String, modifier: Modifier = Modifier, initialSelectedDate: LocalDate? = null, isSelectable: (LocalDate) -> Boolean = { true }, dateContentDescription: (LocalDate) -> String = { it.toString() }, colors: JengaCalendarColors = JengaCalendarDefaults.colors(), dateRange: ClosedRange<LocalDate>? = null, yearPickerLabel: (YearMonth) -> String? = null)(source)

A modal dialog holding a JengaDatePicker with confirm and dismiss actions. The confirm action is enabled once a date is picked.

Parameters

onDismissRequest

called when the dialog is dismissed (dismiss action, scrim tap or back).

onConfirm

called with the picked date when the confirm action is tapped.

confirmLabel

the confirm action label.

dismissLabel

the dismiss action label.

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 dialog surface.

initialSelectedDate

the date selected when the dialog opens.

isSelectable

whether a date can be picked.

dateContentDescription

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

colors

the color set; defaults to JengaCalendarDefaults.colors.

dateRange

the earliest and latest dates that can be picked; see JengaDatePicker.

yearPickerLabel

when set, the month title opens a grid of years; see JengaDatePicker.

Samples

var open by remember {
    mutableStateOf(
        value = true,
    )
}
if (open) {
    JengaDatePickerDialog(
        onDismissRequest = { open = false },
        onConfirm = { open = false },
        confirmLabel = "OK",
        dismissLabel = "Cancel",
        monthTitle = { "${it.month.name} ${it.year}" },
        dayOfWeekLabel = {
            it.name.take(
                n = 2,
            )
        },
        previousMonthContentDescription = "Previous month",
        nextMonthContentDescription = "Next month",
    )
}