Package-level declarations

The picker composables and their state holders: NepaliDatePicker, NepaliDatePickerDialog, NepaliDatePickerDocked, NepaliDatePickerFullScreenDialog, NepaliWheelDatePicker, NepaliDateRangePicker, the *WithEnglishDate variants, the NepaliDateField / NepaliDateInput / NepaliDateRangeField text-entry surfaces, and NepaliCalendarSystemToggle for driving the displayed calendar from your own chrome.

The calendar family lives here as well: NepaliCalendar, NepaliDaySummary, NepaliMonthEventList, and the NepaliCalendarState they share.

Types

Link copied to clipboard

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

Link copied to clipboard

What a NepaliCalendar is showing and what is picked on it.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun NepaliCalendar(state: NepaliCalendarState, modifier: Modifier = Modifier, policy: NepaliCalendarPolicy = NepaliCalendarPolicy.Default, secondaryDateLocale: NepaliDateLocale? = NepaliDatePickerDefaults.DefaultLocale, showTodayButton: Boolean = true, showCalendarSystemToggle: Boolean = false, showAdjacentMonthDays: Boolean = true, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), markerColors: NepaliDayMarkerColors = NepaliDatePickerDefaults.markerColors(), eventDisplayStyle: NepaliEventDisplayStyle = NepaliEventDisplayStyle.Default, dayDecorator: NepaliDayDecorator? = null, onDayClick: (day: CustomCalendar, status: NepaliDayStatus) -> Unit? = null)

A browsable month calendar: a wall patro that fills the width it is given, pages month by month, and names the days an institution is closed for.

Link copied to clipboard
fun NepaliCalendarState(initialSelectedDate: SimpleDate? = null, initialDisplayedMonth: SimpleDate? = initialSelectedDate, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, locale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultLocale, initialCalendarSystem: CalendarSystem = CalendarSystem.BIKRAM_SAMBAT): NepaliCalendarState

Creates a NepaliCalendarState outside composition, which is what a view model or a platform host holds. Prefer rememberNepaliCalendarState inside a composition, since only that one is restored after a configuration change.

Link copied to clipboard
fun NepaliCalendarSystemToggle(calendarSystem: CalendarSystem, onCalendarSystemChange: (CalendarSystem) -> Unit, modifier: Modifier = Modifier, language: NepaliDatePickerLang = NepaliDatePickerLang.ENGLISH, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors())

A two-segment switch between the Bikram Sambat and Gregorian calendars.

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, calendarSystem: CalendarSystem = CalendarSystem.BIKRAM_SAMBAT, showCalendarSystemToggle: Boolean = false, showAdjacentMonthDays: Boolean = false, dayDecorator: NepaliDayDecorator? = null)

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, calendarSystem = state.displayedCalendarSystem ) }, headline: @Composable () -> Unit? = { NepaliDatePickerDefaults.NepaliDatePickerHeadline( selectedDate = state.selectedDate, modifier = Modifier.padding(NepaliDatePickerHeadlinePadding), locale = state.locale, displayMode = state.displayMode, selectedEnglishDate = state.selectedEnglishDate, calendarSystem = state.displayedCalendarSystem ) }, secondaryDateLocale: NepaliDateLocale? = null, showModeToggle: Boolean = true, showTodayButton: Boolean = true, showCalendarSystemToggle: Boolean = false, showAdjacentMonthDays: Boolean = false, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), dayDecorator: NepaliDayDecorator? = null)

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, showCalendarSystemToggle: Boolean = false, showAdjacentMonthDays: Boolean = false, textStyle: TextStyle = LocalTextStyle.current, shape: Shape = OutlinedTextFieldDefaults.shape, interactionSource: MutableInteractionSource? = null, popupShape: Shape = NepaliDatePickerDefaults.shape, popupShadowElevation: Dp = DockedPopupElevation, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), dayDecorator: NepaliDayDecorator? = null)

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, initialCalendarSystem: CalendarSystem = CalendarSystem.BIKRAM_SAMBAT): 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, calendarSystem = state.displayedCalendarSystem ) }, headline: @Composable () -> Unit? = { NepaliDatePickerDefaults.NepaliDatePickerHeadlineWithEnglishDate( modifier = Modifier.padding(NepaliDatePickerHeadlinePadding), selectedDate = state.selectedDate, selectedEnglishDate = state.selectedEnglishDate, locale = state.locale, englishLocale = englishDateLocale, displayMode = state.displayMode, calendarSystem = state.displayedCalendarSystem ) }, showModeToggle: Boolean = true, showTodayButton: Boolean = true, showCalendarSystemToggle: Boolean = false, showAdjacentMonthDays: Boolean = false, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), dayDecorator: NepaliDayDecorator? = null)

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, calendarSystem: CalendarSystem = CalendarSystem.BIKRAM_SAMBAT, showCalendarSystemToggle: Boolean = false, showAdjacentMonthDays: Boolean = false, dayDecorator: NepaliDayDecorator? = null)

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, calendarSystem = state.displayedCalendarSystem ) }, headline: @Composable () -> Unit? = { NepaliDatePickerDefaults.NepaliDateRangePickerHeadline( modifier = Modifier.padding(NepaliDateRangePickerHeadlinePadding), selectedStartDate = state.selectedStartNepaliDate, selectedEndDate = state.selectedEndNepaliDate, locale = state.locale, selectedStartEnglishDate = state.selectedStartEnglishDate, selectedEndEnglishDate = state.selectedEndEnglishDate, calendarSystem = state.displayedCalendarSystem ) }, showModeToggle: Boolean = true, showTodayButton: Boolean = true, showMonthsVertically: Boolean = true, showYearPickerAndMonthNavigation: Boolean = true, secondaryDateLocale: NepaliDateLocale? = null, showCalendarSystemToggle: Boolean = false, showAdjacentMonthDays: Boolean = false, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), dayDecorator: NepaliDayDecorator? = null)

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, initialCalendarSystem: CalendarSystem = CalendarSystem.BIKRAM_SAMBAT): 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, calendarSystem = state.displayedCalendarSystem ) }, 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, calendarSystem = state.displayedCalendarSystem ) }, showModeToggle: Boolean = true, showTodayButton: Boolean = true, showMonthsVertically: Boolean = true, showYearPickerAndMonthNavigation: Boolean = true, showCalendarSystemToggle: Boolean = false, showAdjacentMonthDays: Boolean = false, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), dayDecorator: NepaliDayDecorator? = null)

NepaliDateRangePickerWithEnglishDate 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, calendarSystem: CalendarSystem = CalendarSystem.BIKRAM_SAMBAT)

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(), calendarSystem: CalendarSystem = CalendarSystem.BIKRAM_SAMBAT)

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

Link copied to clipboard
fun NepaliDaySummary(state: NepaliCalendarState, modifier: Modifier = Modifier, policy: NepaliCalendarPolicy = NepaliCalendarPolicy.Default, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), markerColors: NepaliDayMarkerColors = NepaliDatePickerDefaults.markerColors())

The day picked on a calendar, written out. Follows state, and says so when nothing is picked yet.

fun NepaliDaySummary(date: SimpleDate, modifier: Modifier = Modifier, policy: NepaliCalendarPolicy = NepaliCalendarPolicy.Default, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), markerColors: NepaliDayMarkerColors = NepaliDatePickerDefaults.markerColors(), locale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultLocale)

What one day is, written out: whether the institution is shut, why, and everything named on it.

Link copied to clipboard
fun NepaliMonthEventList(state: NepaliCalendarState, modifier: Modifier = Modifier, policy: NepaliCalendarPolicy = NepaliCalendarPolicy.Default, colors: NepaliDatePickerColors = NepaliDatePickerDefaults.colors(), markerColors: NepaliDayMarkerColors = NepaliDatePickerDefaults.markerColors(), onEventClick: (NepaliCalendarEvent) -> Unit? = null, emptyContent: @Composable () -> Unit = { Text( text = state.locale.language.noEventsInMonthText, modifier = Modifier.padding(vertical = EventLinePadding), style = MaterialTheme.typography.bodySmall ) })

Everything named in the month a NepaliCalendar is showing, written out in date order.

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, initialCalendarSystem: CalendarSystem = CalendarSystem.BIKRAM_SAMBAT, showCalendarSystemToggle: Boolean = false, onDateChange: (CustomCalendar) -> Unit)

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

Link copied to clipboard
fun rememberNepaliCalendarState(initialSelectedDate: SimpleDate? = null, initialDisplayedMonth: SimpleDate? = initialSelectedDate, yearRange: IntRange = NepaliCalendarDefaults.NepaliYearRange, locale: NepaliDateLocale = NepaliDatePickerDefaults.DefaultLocale, initialCalendarSystem: CalendarSystem = CalendarSystem.BIKRAM_SAMBAT): NepaliCalendarState

Creates a NepaliCalendarState remembered across compositions and restored after configuration changes. Only the selection, the displayed month and the displayed calendar are saved; events belong to the policy a surface is given, and are never stored here.

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, initialCalendarSystem: CalendarSystem = CalendarSystem.BIKRAM_SAMBAT): 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, initialCalendarSystem: CalendarSystem = CalendarSystem.BIKRAM_SAMBAT): NepaliDateRangePickerState

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