Package-level declarations

Types

Link copied to clipboard
enum Church : Enum<Church>

Easter computus used by HolidayDate.EasterOffset.

Link copied to clipboard
class HolidayCalendar(val country: String, val rules: List<HolidayRule>)

Holidays of one country, computed from rules. Build your own (company days off, observances) with the same HolidayRule types, or get a built-in one from PublicHolidays.

Link copied to clipboard
sealed interface HolidayDate

How a HolidayRule picks its date in a Gregorian year.

Link copied to clipboard
data class HolidayRule(val id: String, val names: Map<String, String>, val date: HolidayDate, val type: HolidayType = HolidayType.Public, val years: IntRange = Int.MIN_VALUE..Int.MAX_VALUE, val observance: Observance = Observance.None, val subdivisions: Set<String>? = null)

One holiday definition in a HolidayCalendar.

Link copied to clipboard

Kind of day, used to filter holidays.

Link copied to clipboard

What happens when a holiday falls on a weekend.

Link copied to clipboard
data class PublicHoliday(val date: LocalDate, val ruleId: String, val name: String, val type: HolidayType, val isSubstitute: Boolean = false, val isEstimated: Boolean = false)

One holiday occurrence produced by HolidayCalendar.

Link copied to clipboard
class PublicHolidayDayInfoProvider(calendar: HolidayCalendar, subdivision: String? = null, language: String? = null, types: Set<HolidayType> = setOf(HolidayType.Public, HolidayType.Bank)) : DayInfoProvider

DayInfoProvider that marks the holidays of calendar: DayInfo.label is the holiday name, DayInfo.isHoliday is true and DayInfo.priority is DayInfoPriority.PUBLIC_HOLIDAY, so it wins the label when combined with +, for example PublicHolidayDayInfoProvider(PublicHolidays.forCountry("US")!!) + LunarDayInfoProvider().

Link copied to clipboard

Built-in holiday calendars, written from each country's statutes and official government pages (sources are listed in the rule files). Rules are pure Kotlin: no network and no resource files.

Functions

Link copied to clipboard
fun easterSunday(year: Int, church: Church = Church.Western): LocalDate

Easter Sunday of year as a Gregorian date.