Package-level declarations

The picker composables and their state holders: NepaliDatePicker, NepaliDatePickerDialog, NepaliDatePickerDocked, NepaliDatePickerFullScreenDialog, NepaliWheelDatePicker, NepaliDateRangePicker, the *WithEnglishDate variants, and the NepaliDateField / NepaliDateInput / NepaliDateRangeField text-entry surfaces.

Types

Link copied to clipboard

Represents the different modes that a date picker can be at.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun NepaliDateField(value: SimpleDate?, onValueChange: (SimpleDate?) -> Unit, modifier: Modifier = Modifier, dateFormat: NepaliDateFormatter.Pattern = Pattern.YYYY_SLASH_MM_SLASH_DD, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, selectableDates: NepaliSelectableDates = NepaliDatePickerDefaults.AllDates, locale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultLocale, label: @Composable () -> Unit? = null, placeholder: @Composable () -> Unit? = { androidx.compose.material3.Text(dateFormat.literal) }, supportingText: @Composable () -> Unit? = null, leadingIcon: @Composable () -> Unit? = null, isError: Boolean = false, enabled: Boolean = true, readOnly: Boolean = false, keyboardOptions: KeyboardOptions = KeyboardOptions( autoCorrectEnabled = false, keyboardType = KeyboardType.Number, imeAction = ImeAction.Done ), keyboardActions: KeyboardActions = KeyboardActions.Default, textStyle: TextStyle = LocalTextStyle.current, prefix: @Composable () -> Unit? = null, suffix: @Composable () -> Unit? = null, shape: Shape = OutlinedTextFieldDefaults.shape, interactionSource: MutableInteractionSource? = null, colors: TextFieldColors = OutlinedTextFieldDefaults.colors(), dialogProperties: DialogProperties = DialogProperties(), confirmButtonText: String = locale.language.okText, dismissButtonText: String = locale.language.cancelText)

Material3-style date field - NepaliDateTextField with a trailing calendar icon that opens NepaliDatePickerDialog.

Link copied to clipboard
fun NepaliDatePicker(state: NepaliDatePickerState, modifier: Modifier = Modifier, title: @Composable () -> Unit? = { NepaliDatePickerDefaults.NepaliDatePickerTitle( modifier = Modifier.padding(NepaliDatePickerTitlePadding), language = state.locale.language, displayMode = state.displayMode ) }, headline: @Composable () -> Unit? = { NepaliDatePickerDefaults.NepaliDatePickerHeadline( selectedDate = state.selectedDate, modifier = Modifier.padding(NepaliDatePickerHeadlinePadding), locale = state.locale, displayMode = state.displayMode ) }, showModeToggle: Boolean = true, showTodayButton: Boolean = true, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors())

Nepali Date Picker lets user select a date and preferably should be embedded into Dialogs. See NepaliDatePickerDialog.

Link copied to clipboard
fun NepaliDatePickerDialog(onDismissRequest: () -> Unit, confirmButton: @Composable () -> Unit, modifier: Modifier = Modifier, dismissButton: @Composable () -> Unit? = null, shape: Shape = NepaliDatePickerDefaults.shape, tonalElevation: Dp = NepaliDatePickerDefaults.TonalElevation, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), properties: DialogProperties = DialogProperties(usePlatformDefaultWidth = false), content: @Composable ColumnScope.() -> Unit)

A dialog for displaying a NepaliDatePicker. Date pickers let people select a date.

Link copied to clipboard
fun NepaliDatePickerDocked(state: NepaliDatePickerState, modifier: Modifier = Modifier, label: @Composable () -> Unit? = null, placeholder: @Composable () -> Unit? = null, trailingIcon: @Composable () -> Unit? = null, prefix: @Composable () -> Unit? = null, suffix: @Composable () -> Unit? = null, dateFormatStyle: NepaliDateFormatStyle = NepaliDateFormatStyle.MEDIUM, showTodayButton: Boolean = true, textStyle: TextStyle = LocalTextStyle.current, shape: Shape = OutlinedTextFieldDefaults.shape, interactionSource: MutableInteractionSource? = null, popupShape: Shape = NepaliDatePickerDefaults.shape, popupShadowElevation: Dp = DockedPopupElevation, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors())

A docked / compact Nepali date picker: a read-only text field showing the selected date, with a trailing calendar button that opens the NepaliDatePicker in a dropdown anchored to the field.

Link copied to clipboard
fun NepaliDatePickerFullScreenDialog(onDismissRequest: () -> Unit, confirmButton: @Composable () -> Unit, modifier: Modifier = Modifier, dismissButton: @Composable () -> Unit? = null, title: @Composable () -> Unit? = null, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), properties: DialogProperties = DialogProperties(usePlatformDefaultWidth = false), content: @Composable ColumnScope.() -> Unit)

A full-screen dialog host for the Nepali date/range pickers.

Link copied to clipboard
fun NepaliDatePickerState(initialSelectedDate: SimpleDate? = null, initialDisplayedMonth: SimpleDate? = initialSelectedDate, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, initialDisplayMode: DisplayMode = DisplayMode.Picker, nepaliSelectableDates: NepaliSelectableDates = NepaliDatePickerDefaults.AllDates, locale: NepaliDateLocale): NepaliDatePickerState

Creates NepaliDatePickerState. Primarily recommended for outside composition.

Link copied to clipboard
fun NepaliDatePickerWithEnglishDate(state: NepaliDatePickerState, modifier: Modifier = Modifier, englishDateLocale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultLocale, title: @Composable () -> Unit? = { NepaliDatePickerDefaults.NepaliDatePickerTitle( modifier = Modifier.padding(NepaliDatePickerTitlePadding), language = state.locale.language, displayMode = state.displayMode ) }, headline: @Composable () -> Unit? = { NepaliDatePickerDefaults.NepaliDatePickerHeadlineWithEnglishDate( modifier = Modifier.padding(NepaliDatePickerHeadlinePadding), selectedDate = state.selectedDate, selectedEnglishDate = state.selectedEnglishDate, locale = state.locale, englishLocale = englishDateLocale, displayMode = state.displayMode ) }, showModeToggle: Boolean = true, showTodayButton: Boolean = true, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors())

NepaliDatePickerWithEnglishDate lets user select a date and preferably should be embedded into Dialogs. Check NepaliDatePickerDialog.

Link copied to clipboard
fun NepaliDateRangeField(startValue: SimpleDate?, endValue: SimpleDate?, onRangeChange: (start: SimpleDate?, end: SimpleDate?) -> Unit, modifier: Modifier = Modifier, dateFormat: NepaliDateFormatter.Pattern = Pattern.YYYY_SLASH_MM_SLASH_DD, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, selectableDates: NepaliSelectableDates = NepaliDatePickerDefaults.AllDates, locale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultRangePickerLocale, startLabel: @Composable () -> Unit? = { Text(locale.language.startDate) }, endLabel: @Composable () -> Unit? = { Text(locale.language.endDate) }, supportingText: @Composable () -> Unit? = null, isStartError: Boolean = false, isEndError: Boolean = false, enabled: Boolean = true, readOnly: Boolean = false, keyboardOptions: KeyboardOptions = KeyboardOptions( autoCorrectEnabled = false, keyboardType = KeyboardType.Number, imeAction = ImeAction.Next ), keyboardActions: KeyboardActions = KeyboardActions.Default, colors: TextFieldColors = OutlinedTextFieldDefaults.colors(), textStyle: TextStyle = LocalTextStyle.current, shape: Shape = OutlinedTextFieldDefaults.shape, startPrefix: @Composable () -> Unit? = null, endPrefix: @Composable () -> Unit? = null, startSuffix: @Composable () -> Unit? = null, endSuffix: @Composable () -> Unit? = null, startInteractionSource: MutableInteractionSource? = null, endInteractionSource: MutableInteractionSource? = null, dialogProperties: DialogProperties = DialogProperties(), confirmButtonText: String = locale.language.okText, dismissButtonText: String = locale.language.cancelText)

Material3-style range field - NepaliDateRangeTextField with a trailing calendar icon that opens NepaliDatePickerDialog hosting NepaliDateRangePicker.

Link copied to clipboard
fun NepaliDateRangePicker(state: NepaliDateRangePickerState, modifier: Modifier = Modifier, title: @Composable () -> Unit? = { NepaliDatePickerDefaults.NepaliDateRangePickerTitle( modifier = Modifier.padding(NepaliDateRangePickerTitlePadding), language = state.locale.language, displayMode = state.displayMode ) }, headline: @Composable () -> Unit? = { NepaliDatePickerDefaults.NepaliDateRangePickerHeadline( modifier = Modifier.padding(NepaliDateRangePickerHeadlinePadding), selectedStartDate = state.selectedStartNepaliDate, selectedEndDate = state.selectedEndNepaliDate, locale = state.locale ) }, showModeToggle: Boolean = true, showTodayButton: Boolean = true, showMonthsVertically: Boolean = true, showYearPickerAndMonthNavigation: Boolean = true, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors())

Nepali Date Range Picker let people select a range of Nepali dates and can be embedded into dialogs. See NepaliDatePickerDialog

Link copied to clipboard
fun NepaliDateRangePickerState(initialSelectedStartNepaliDate: SimpleDate? = null, initialSelectedEndNepaliDate: SimpleDate? = null, initialDisplayedMonth: SimpleDate? = initialSelectedStartNepaliDate, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, initialDisplayMode: DisplayMode = DisplayMode.Picker, nepaliSelectableDates: NepaliSelectableDates = NepaliDatePickerDefaults.AllDates, locale: NepaliDateLocale): NepaliDateRangePickerState

Creates a NepaliDateRangePickerState. Primarily recommended for outside composition.

Link copied to clipboard
fun NepaliDateRangePickerWithEnglishDate(state: NepaliDateRangePickerState, modifier: Modifier = Modifier, englishDateLocale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultLocale, title: @Composable () -> Unit? = { NepaliDatePickerDefaults.NepaliDateRangePickerTitle( modifier = Modifier.padding(NepaliDateRangePickerTitlePadding), language = state.locale.language, displayMode = state.displayMode ) }, headline: @Composable () -> Unit? = { NepaliDatePickerDefaults.NepaliDateRangePickerHeadlineWithEnglishDate( modifier = Modifier.padding(NepaliEnglishDateRangePickerHeadlinePadding), selectedNepaliStartDate = state.selectedStartNepaliDate, selectedNepaliEndDate = state.selectedEndNepaliDate, selectedEnglishStartDate = state.selectedStartEnglishDate, selectedEnglishEndDate = state.selectedEndEnglishDate, englishLocale = englishDateLocale, locale = state.locale ) }, showModeToggle: Boolean = true, showTodayButton: Boolean = true, showMonthsVertically: Boolean = true, showYearPickerAndMonthNavigation: Boolean = true, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors())

NNepaliDateRangePickerWithEnglishDate let people select a range of Nepali dates and can be embedded into dialogs. See NepaliDatePickerDialog

Link copied to clipboard
fun NepaliDateRangeTextField(startValue: SimpleDate?, endValue: SimpleDate?, onRangeChange: (start: SimpleDate?, end: SimpleDate?) -> Unit, modifier: Modifier = Modifier, dateFormat: NepaliDateFormatter.Pattern = Pattern.YYYY_SLASH_MM_SLASH_DD, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, selectableDates: NepaliSelectableDates = NepaliDatePickerDefaults.AllDates, locale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultRangePickerLocale, startLabel: @Composable () -> Unit? = { Text(locale.language.startDate) }, endLabel: @Composable () -> Unit? = { Text(locale.language.endDate) }, supportingText: @Composable () -> Unit? = null, isStartError: Boolean = false, isEndError: Boolean = false, enabled: Boolean = true, readOnly: Boolean = false, keyboardOptions: KeyboardOptions = KeyboardOptions( autoCorrectEnabled = false, keyboardType = KeyboardType.Number, imeAction = ImeAction.Next ), keyboardActions: KeyboardActions = KeyboardActions.Default, colors: TextFieldColors = OutlinedTextFieldDefaults.colors(), textStyle: TextStyle = LocalTextStyle.current, shape: Shape = OutlinedTextFieldDefaults.shape, startPrefix: @Composable () -> Unit? = null, endPrefix: @Composable () -> Unit? = null, startSuffix: @Composable () -> Unit? = null, endSuffix: @Composable () -> Unit? = null, startInteractionSource: MutableInteractionSource? = null, endInteractionSource: MutableInteractionSource? = null)

Two stacked NepaliDateTextFields editing a Bikram Sambat date range.

Link copied to clipboard
fun NepaliDateTextField(value: SimpleDate?, onValueChange: (SimpleDate?) -> Unit, modifier: Modifier = Modifier, dateFormat: NepaliDateFormatter.Pattern = Pattern.YYYY_SLASH_MM_SLASH_DD, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, selectableDates: NepaliSelectableDates = NepaliDatePickerDefaults.AllDates, locale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultLocale, label: @Composable () -> Unit? = null, placeholder: @Composable () -> Unit? = { androidx.compose.material3.Text(dateFormat.literal) }, supportingText: @Composable () -> Unit? = null, leadingIcon: @Composable () -> Unit? = null, trailingIcon: @Composable () -> Unit? = null, isError: Boolean = false, enabled: Boolean = true, readOnly: Boolean = false, keyboardOptions: KeyboardOptions = KeyboardOptions( autoCorrectEnabled = false, keyboardType = KeyboardType.Number, imeAction = ImeAction.Done ), keyboardActions: KeyboardActions = KeyboardActions.Default, textStyle: TextStyle = LocalTextStyle.current, prefix: @Composable () -> Unit? = null, suffix: @Composable () -> Unit? = null, shape: Shape = OutlinedTextFieldDefaults.shape, interactionSource: MutableInteractionSource? = null, colors: TextFieldColors = OutlinedTextFieldDefaults.colors())

Standalone outlined text field that edits a Nepali (Bikram Sambat) SimpleDate.

Link copied to clipboard
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)

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

Link copied to clipboard
fun rememberNepaliDatePickerState(initialSelectedDate: SimpleDate? = null, initialDisplayedMonth: SimpleDate? = initialSelectedDate, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, initialDisplayMode: DisplayMode = DisplayMode.Picker, nepaliSelectableDates: NepaliSelectableDates = NepaliDatePickerDefaults.AllDates, locale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultLocale): NepaliDatePickerState

Creates a NepaliDatePickerState for a NepaliDatePicker that is remembered across compositions.

Link copied to clipboard
fun rememberNepaliDateRangePickerState(initialSelectedStartNepaliDate: SimpleDate? = null, initialSelectedEndNepaliDate: SimpleDate? = null, initialDisplayedMonth: SimpleDate? = initialSelectedStartNepaliDate, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, initialDisplayMode: DisplayMode = DisplayMode.Picker, nepaliSelectableDates: NepaliSelectableDates = NepaliDatePickerDefaults.AllDates, locale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultRangePickerLocale): NepaliDateRangePickerState

Creates a NepaliDateRangePickerState for a NepaliDateRangePicker that is remembered across compositions.