NepaliCalendar
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.
Unlike NepaliDatePicker, which asks for a date and is sized for a dialog, this fills its container and shows both calendars' numbers by default, which is how a Nepali calendar is read. It draws at a fixed height, six week rows whatever the month's shape, and never scrolls vertically, so it sits as one block inside a screen's own scrolling content. Give it a bounded width; an unbounded one, a horizontal scroller or a Row without a weight, has nothing for the month pager to fill.
Events are first-class here: policy decides which days are closed and what is named on them, and the grid marks them without any further wiring. The policy is read once per visible month rather than once per day, so a provider answering from a memoized source keeps paging cheap. Pair the calendar with NepaliMonthEventList and NepaliDaySummary over the same state and policy to write those days out.
Parameters
what is shown and what is picked. See rememberNepaliCalendarState.
the Modifier applied to the calendar.
the institution the calendar describes: the days of the week it never opens, and the events it keeps. Defaults to Nepal's usual office week, Saturday off, with no events.
pairs every cell with the same day in the other calendar, in this locale's language and digits. On by default, since a Nepali calendar is usually read against the Gregorian one; pass null for a single number per cell.
whether the header offers a button back to today's month.
whether the header carries the B.S. / A.D. switch, which drives NepaliCalendarState.displayedCalendarSystem.
whether the empty slots around the month are filled with its neighbours' days, drawn faded. On by default, which is what makes the grid read as a wall calendar. Tapping one picks that day and moves the calendar to its month.
the NepaliDatePickerColors the calendar themes itself from.
the palette a marked day is drawn in, one slot per kind of event.
how much of a day's status is drawn: its colour, its dots, its disc, and what a screen reader is told.
an app's own marks, laid over the policy's. The policy's colour leads and the dots of both are drawn, so a public holiday that also carries two meetings keeps the holiday's colour and gains the meetings' dots. Hoist it in a remember, as NepaliDayDecorator asks.
invoked after a tapped day becomes the selection, with the day and what policy says about it. A day with no Bikram Sambat date, which only happens before the conversion anchor, is inert and never calls this.
Example usage:
val state = rememberNepaliCalendarState()
val policy = remember { NepaliCalendarPolicy(provider = myEvents) }
LazyColumn {
item { NepaliCalendar(state = state, policy = policy) }
item { NepaliDaySummary(state = state, policy = policy) }
item { NepaliMonthEventList(state = state, policy = policy) }
}