HolidayRule

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.

Constructors

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

Properties

Link copied to clipboard
Link copied to clipboard
val id: String

Stable identifier, e.g. "us.independence-day".

Link copied to clipboard

Holiday name by BCP-47 language tag; contains "en" and usually the local language.

Link copied to clipboard
Link copied to clipboard

ISO 3166-2 subdivision codes (e.g. "DE-BY") the rule applies to, or null for the whole country.

Link copied to clipboard
Link copied to clipboard

Years in which the rule applies, so a law change becomes two rules.

Functions

Link copied to clipboard
fun name(language: String?): String

The name in language, falling back to its primary language subtag ("de-DE" and "de_AT" find "de") and then to English.