KwikDateRangeButton

fun KwikDateRangeButton(modifier: Modifier = Modifier, label: String? = null, onDateRangeSelected: (Pair<LocalDate, LocalDate>) -> Unit, minSelectableDate: Long? = null, maxSelectableDate: Long? = null, showModeToggle: Boolean = false, dialogShape: Shape = MaterialTheme.shapes.medium, colors: DatePickerColors = kwikDatePickerColors(), onClick: () -> Unit = {}, border: BorderStroke? = null, shape: Shape = MaterialTheme.shapes.medium, datePlaceholder: String = "Select dates", leadingIcon: @Composable () -> Unit? = { Icon( painter = painterResource(id = R.drawable.calendar), tint = MaterialTheme.colorScheme.onSurface, contentDescription = null, ) }, trailingIcon: @Composable () -> Unit? = { Icon( imageVector = Icons.Default.KeyboardArrowDown, tint = MaterialTheme.colorScheme.onSurface, contentDescription = null, ) })

A date button with a label and a date. When clicked, a date range picker dialog will be shown.

Parameters

label

: The label for the date field.

onDateRangeSelected

: Callback that is called when a date range is selected. The Pair contains the start and end dates.

minSelectableDate

: The minimum selectable date in milliseconds since epoch. If null, 99 years before today is used.

maxSelectableDate

: The maximum selectable date in milliseconds since epoch. If null, 99 years from today is used.

showModeToggle

: Whether to show the mode toggle button.

dialogShape

: The shape of the date picker dialog.

colors

: The colors to use for the date picker.

onClick

: Callback that is called when the date field is clicked.

border

: The border to use for the date field.

shape

: The shape of the date field.

leadingIcon

: The leading icon to use for the date field.

trailingIcon

: The trailing icon to use for the date field.