Package-level declarations
Calendar-event SPI. NepaliCalendarEvent is one thing on one day, a public holiday, a festival, a programme or a meeting, and closesOffices says whether the institution is actually shut for it. NepaliEventProvider supplies them, NepaliCalendarPolicy pairs that list with the weekdays an institution never opens and answers statusOf / eventsOn / eventsIn / monthStatus, and the working-day helpers count by the same rule. spanningDays and spanningThrough expand something that runs longer than a day into the per-day entries the rest of the package reads. No event dataset ships with the library by design.
Types
Something that happens on one Bikram Sambat day: a public holiday, a festival, a school programme, a deadline, a birthday.
When one institution is closed, and what its calendar has on it: the days of the week it never opens, plus the events it keeps.
What one day is, as far as a NepaliCalendarPolicy is concerned: whether the week makes it a day off, and what is named on it.
What kind of thing an event is, which is what a calendar colors by.
Service-provider interface for supplying a calendar's events: public holidays, festivals, programmes, anything an app wants named on a day.
Day-of-week conventions.
No-op provider. Use as a default when an app wants the event-aware APIs but has not wired a data source yet. Behaves as if nothing is ever named and nothing ever closes.
Functions
The date days working days from from for the institution policy describes, with the Excel WORKDAY semantics of the provider overload.
Returns a NepaliSelectableDates that delegates to this one but additionally rejects any date provider says the institution is shut for.
Returns a NepaliSelectableDates that delegates to this one but additionally rejects weekend days as defined by weekend (default: Saturday only).
A view of this provider carrying only the entries predicate accepts, for narrowing a shared list to what one screen cares about: filtered { it.kind == NepaliEventKind.GovernmentPublic }.
First working day at or after from for the institution policy describes. Returns from itself when that is already a working day.
A provider reporting everything either side reports, which is how a national list and an institution's own list are put together.
This event on each of days consecutive days, starting on its own date, for a festival or a leave that runs longer than one day.
This event on each day from its own date through end, both ends included, which is the shape published holiday lists and leave requests usually state a span in.
Number of working days in the half-open range [start, end) for the institution policy describes, skipping both its weekly off days and the events that close it.