NepaliWheelDatePicker

fun NepaliWheelDatePicker(modifier: Modifier = Modifier, initialDate: SimpleDate = NepaliDateConverter.todayNepaliSimpleDate, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, locale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultLocale, selectableDates: NepaliSelectableDates = NepaliDatePickerDefaults.AllDates, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), itemHeight: Dp = WheelItemHeight, visibleItemCount: Int = WheelVisibleCount, shape: Shape = RoundedCornerShape(WheelCornerRadius), selectedTextStyle: TextStyle = MaterialTheme.typography.titleMedium, unselectedTextStyle: TextStyle = MaterialTheme.typography.bodyLarge, onDateChange: (CustomCalendar) -> Unit)(source)

A wheel / scroll date picker for Bikram Sambat dates - three snapping columns (Year, Month, Day).

This is a lighter-weight alternative to the calendar-grid NepaliDatePicker: it is the pattern users reach for when entering a birth date or a date far from today, and it is the native feel on iOS. It also sidesteps the grid's heaviest paths - there is no ~1,500-item month pager and no per-cell BS to AD conversion; each column is a bounded LazyColumn reading the day-count table directly, so the day column always shows the correct 29 to 32 days for the chosen month.

The composable is always in a selected state (a wheel cannot be "empty"); onDateChange fires with the resolved CustomCalendar whenever the selection settles on a new date.

Parameters

modifier

the Modifier applied to the picker surface.

initialDate

the SimpleDate shown centered on first composition. Defaults to today.

yearRange

the selectable Bikram Sambat year range.

locale

the NepaliDateLocale controlling language, month names, and digit script.

selectableDates

consulted via NepaliSelectableDates.isSelectableYear to drop non-selectable years from the year wheel. Fine-grained per-day disabling is not expressed by a wheel by design.

colors

the NepaliDatePickerColors used to theme the picker.

itemHeight

the height of each wheel row.

visibleItemCount

how many rows are visible at once; coerced to an odd number of at least 3.

shape

the Shape of the wheel surface.

selectedTextStyle

the TextStyle of the centered (selected) row.

unselectedTextStyle

the TextStyle of the non-centered rows.

onDateChange

invoked with the resolved CustomCalendar when the selected date changes.

Example usage:

NepaliWheelDatePicker(
initialDate = NepaliDateConverter.todayNepaliSimpleDate,
onDateChange = { selected -> /* ... */}
)

See also