HolidayDate

sealed interface HolidayDate

How a HolidayRule picks its date in a Gregorian year.

Inheritors

Types

Link copied to clipboard
data class EasterOffset(val days: Int, val church: Church = Church.Western) : HolidayDate

days after Easter Sunday of church (negative for days before).

Link copied to clipboard
data class Fixed(val month: Month, val day: Int) : HolidayDate

The same month and day every year.

Link copied to clipboard
data class HijriFixed(val month: Int, val day: Int) : HolidayDate

A fixed Umm al-Qura Hijri month/day; may fall twice or not at all in a Gregorian year. Holidays from these rules are marked PublicHoliday.isEstimated.

Link copied to clipboard
data class NthWeekday(val month: Month, val dayOfWeek: DayOfWeek, val n: Int) : HolidayDate

The nth dayOfWeek of month; n = -1 is the last one. With n = 5 the rule produces no date in years where month has only four such weekdays.

Link copied to clipboard
data class OneOff(val date: LocalDate) : HolidayDate

One specific date, e.g. a coronation bank holiday.

Link copied to clipboard
data class PersianFixed(val month: Int, val day: Int) : HolidayDate

A fixed Persian (Jalali) month/day.

Link copied to clipboard
data class WeekdayRelative(val month: Month, val day: Int, val dayOfWeek: DayOfWeek, val after: Boolean) : HolidayDate

The first dayOfWeek strictly after (after = true) or strictly before (after = false) month/day, e.g. German Repentance Day is the Wednesday before 23 November.