NepaliHolidayProvider
Service-provider interface for supplying holiday data to the picker.
This library ships no holiday data by design - Nepali public, religious, and regional holiday lists change year to year, and we don't want consumers stuck on stale data baked into the library. Implement this interface with your own source (a static map, a CMS, an HR API, the Patro paid catalog, …) and pass it to the helpers in this package.
Implementations must:
return a stable Set for a given year (calling twice should yield the same contents),
be safe to call from the UI thread (results are cached internally by helpers that need many lookups, but the first call per year still happens on the caller's thread),
not throw for years outside dev.shivathapaa.nepalidatepickerkmp.calendar_model.NepaliCalendarDefaults.NepaliYearRange; return emptySet instead.
Example:
object MyHolidays : NepaliHolidayProvider {
private val staticByYear: Map<Int, Set<HolidayEntry>> = mapOf(
2082 to setOf(
HolidayEntry(SimpleDate(2082, 1, 1), "नयाँ वर्ष", HolidayKind.GovernmentPublic),
// …
)
)
override fun holidays(year: Int): Set<HolidayEntry> = staticByYear[year].orEmpty()
}The reference paid implementation of this SPI is dev.shivathapaa.patro:patro-calendar, which ships curated holiday + festival data alongside its inline calendar UI.