API Reference

HolidayCalendar (static entry point)

Basic queries

MemberReturnsDescription
IsHoliday(DateTime)boolWhether the day is off (weekend/holiday/make-up holiday/adjusted); throws when out of range
IsWorkday(DateTime)boolWhether the day is a workday (regular or make-up workday)
GetDayInfo(DateTime)TaiwanDayInfoComplete day info
TryGetDayInfo(DateTime, out TaiwanDayInfo?)boolReturns false (no throw) when out of range

DateOnly overloads are available on net8+ (IsHoliday / IsWorkday / GetDayInfo).

Yearly lists

MemberReturnsDescription
GetHolidays(int year)IReadOnlyList<TaiwanDayInfo>Holidays / make-up holidays / adjusted days off (regular weekends excluded)
GetMakeupWorkdays(int year)IReadOnlyList<TaiwanDayInfo>Make-up workdays

Scheduling helpers

MemberReturnsDescription
GetNextWorkday(DateTime)DateTimeNext workday (exclusive)
GetPreviousWorkday(DateTime)DateTimePrevious workday (exclusive)
CountWorkdays(from, to)intInclusive workday count; throws ArgumentException when from > to
GetHolidayPeriods(int year)IReadOnlyList<HolidayPeriod>3+ day breaks; cross-year periods appear untruncated in both years

Coverage

MemberValue
MinDate2017-01-01
MaxDate2027-12-31
SupportedYears2017-2027

TaiwanDayInfo

PropertyTypeDescription
DateDateTimeThe date
KindDayKindDay classification
Namestring?Official holiday/make-up name (e.g. "春節"); null for regular days
EnglishNamestring?English name mapping
IsWorkday / IsHolidayboolConvenience properties

DayKind

ValueDescriptionIsWorkday
WorkdayRegular workday
WeekendRegular weekend
HolidayNational holiday
MakeupHolidayMake-up holiday
AdjustedHolidayAdjusted day off
MakeupWorkdayMake-up workday (Saturday)

HolidayPeriod

PropertyTypeDescription
Start / EndDateTimePeriod boundaries
TotalDaysintTotal days
Name / EnglishNamestring?Representative name (most frequent holiday name, e.g. "春節")

Exception behavior

  • Date/year outside 2017-2027 → ArgumentOutOfRangeException (never guesses)
  • GetNextWorkday / GetPreviousWorkday walking past the data range → same
  • CountWorkdays with from later than to → ArgumentException
  • Only the date part of the input DateTime is used; time and Kind are ignored