NepaliCalendarSystemToggle

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

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

The pickers compose this themselves when showCalendarSystemToggle is on, so reach for it directly only when you are driving NepaliDatePickerState.displayedCalendarSystem from your own chrome (an app bar, a settings row) instead of from inside the picker.

Switching the calendar never changes what is selected: a date picked in one calendar stays picked in the other, because selection is always stored in Bikram Sambat.

Parameters

calendarSystem

the calendar currently shown.

onCalendarSystemChange

invoked with the tapped calendar. Fires only on an actual change.

modifier

the Modifier applied to the switch.

language

the language the segment labels and their content descriptions are written in.

colors

the NepaliDatePickerColors the switch themes itself from; the selected segment uses the selected-day colors so it reads as part of the picker.

Example usage:

val state = rememberNepaliDatePickerState()

NepaliCalendarSystemToggle(
calendarSystem = state.displayedCalendarSystem,
onCalendarSystemChange = { state.displayedCalendarSystem = it }
)

See also