HolidayCalendar class
A calendar of holidays for business day calculations.
Holidays can be defined as specific dates or recurring annual dates.
Constructors
-
HolidayCalendar({List<
DateTime> fixedHolidays = const [], List<(int, int)> annualHolidays = const [], String name = 'Custom'}) -
Creates a holiday calendar with the given holidays.
const
- HolidayCalendar.empty()
-
Creates an empty calendar with no holidays.
const
Properties
-
annualHolidays
→ List<
(int, int)> -
Annual recurring holidays (month, day pairs).
final
-
fixedHolidays
→ List<
DateTime> -
Fixed holidays (specific dates).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The name of this calendar.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
isHoliday(
DateTime date) → bool - Checks if the given date is a holiday.
-
merge(
HolidayCalendar other) → HolidayCalendar - Creates a new calendar by merging with another.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- cnCommon → const HolidayCalendar
- Chinese statutory holidays (fixed dates).
- usCommon → const HolidayCalendar
- US Federal Holidays (fixed dates only, not observed dates).