HolidayCalendar

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.

Constructors

Link copied to clipboard
constructor(country: String, rules: List<HolidayRule>)

Properties

Link copied to clipboard

ISO 3166-1 alpha-2 code, or any label for custom calendars.

Link copied to clipboard

Functions

Link copied to clipboard
fun holidaysIn(year: Int, subdivision: String? = null, language: String? = null): List<PublicHoliday>

Every holiday in year for the whole country plus subdivision (an ISO 3166-2 code such as "DE-BY"), including substitute days, sorted by date and then rule order. Names are English unless language names a language present in the rules' HolidayRule.names.

Link copied to clipboard
fun holidaysOn(date: LocalDate, subdivision: String? = null, language: String? = null): List<PublicHoliday>

Holidays on date (usually zero or one).