rememberNepaliCalendarState

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

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.

Out-of-range or invalid initial values are coerced rather than rejected: the displayed month is clamped into yearRange, and an out-of-range or non-existent initial selected date resolves to no selection.

Parameters

initialSelectedDate

the day picked when the calendar first appears, or null for none.

initialDisplayedMonth

the month shown first. Defaults to the month of initialSelectedDate, and to the current month when there is no selection.

yearRange

the Bikram Sambat years the calendar pages over.

locale

the language, date format and digit script the calendar renders with.

initialCalendarSystem

the calendar shown first.

Example usage:

val state = rememberNepaliCalendarState()
NepaliCalendar(state = state, policy = officePolicy)
NepaliMonthEventList(state = state, policy = officePolicy)