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:

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.

Inheritors

Functions

Link copied to clipboard
abstract fun holidays(year: Int): Set<HolidayEntry>

All holidays for year, BS. Empty set is a valid answer (no holidays / out of range).

Link copied to clipboard
open fun isHoliday(date: SimpleDate): Boolean

Convenience - true if any entry returned by holidays for date.year falls on date.