Ozakboy.TaiwanKit.TaiwanHolidays 1.0.1

dotnet add package Ozakboy.TaiwanKit.TaiwanHolidays --version 1.0.1
                    
NuGet\Install-Package Ozakboy.TaiwanKit.TaiwanHolidays -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ozakboy.TaiwanKit.TaiwanHolidays" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ozakboy.TaiwanKit.TaiwanHolidays" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Ozakboy.TaiwanKit.TaiwanHolidays" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ozakboy.TaiwanKit.TaiwanHolidays --version 1.0.1
                    
#r "nuget: Ozakboy.TaiwanKit.TaiwanHolidays, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ozakboy.TaiwanKit.TaiwanHolidays@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ozakboy.TaiwanKit.TaiwanHolidays&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Ozakboy.TaiwanKit.TaiwanHolidays&version=1.0.1
                    
Install as a Cake Tool

<p align="center"> <img src="https://raw.githubusercontent.com/ozakboy/Ozakboy.TaiwanKit.TaiwanHolidays/main/logo.png" width="128" alt="Ozakboy.TaiwanKit logo" /> </p>

Ozakboy.TaiwanKit.TaiwanHolidays

繁體中文

Taiwan national holidays and make-up workday queries for .NET. Official government office calendar data (2017–2027) embedded — works fully offline, zero runtime dependencies.

Part of the Ozakboy.TaiwanKit series.

Features

  • Holiday / workday checksIsHoliday / IsWorkday, correctly treating make-up Saturdays as workdays
  • Day details — six-way day classification (workday / weekend / holiday / make-up holiday / adjusted day off / make-up workday) with official holiday names (zh-TW + English)
  • Scheduling helpers — next/previous workday, workday counting between dates, consecutive holiday periods (e.g. the 9-day Lunar New Year break)
  • Official data embedded — sourced from Taiwan's DGPA "government office calendar" open data (data.gov.tw dataset 14718), including the post-2025 new statutory holidays; new years ship as minor package updates
  • Explicit range semantics — queries outside 2017–2027 throw (never guess); TryGetDayInfo and MinDate/MaxDate for graceful handling

Install

dotnet add package Ozakboy.TaiwanKit.TaiwanHolidays

Supported frameworks: netstandard2.0 / netstandard2.1 / net8.0 / net9.0 / net10.0 (with DateOnly overloads on net8+)

Quick start

using Ozakboy.TaiwanKit.TaiwanHolidays;

HolidayCalendar.IsHoliday(new DateTime(2026, 10, 10));   // true  (National Day)
HolidayCalendar.IsWorkday(new DateTime(2023, 1, 7));     // true  (make-up Saturday!)

TaiwanDayInfo info = HolidayCalendar.GetDayInfo(new DateTime(2026, 2, 17));
// info.Kind        → DayKind.Holiday
// info.Name        → "春節"
// info.EnglishName → "Lunar New Year"

// Scheduling helpers
HolidayCalendar.GetNextWorkday(new DateTime(2026, 2, 13));                       // 2026-02-23 (after the CNY break)
HolidayCalendar.CountWorkdays(new DateTime(2026, 2, 1), new DateTime(2026, 2, 28)); // workdays in Feb 2026

// Consecutive holiday periods
foreach (HolidayPeriod p in HolidayCalendar.GetHolidayPeriods(2026))
{
    Console.WriteLine($"{p.Start:MM/dd}~{p.End:MM/dd} {p.TotalDays} days {p.Name}");
}
// e.g. 02/14~02/22 9 days 春節

// Out-of-range handling
HolidayCalendar.TryGetDayInfo(new DateTime(2030, 1, 1), out _);  // false — data not covered, no guessing

API overview

Member Description
IsHoliday(date) / IsWorkday(date) Day-off / workday check (throws outside covered range)
GetDayInfo(date)TaiwanDayInfo Kind, holiday name (zh-TW + en)
TryGetDayInfo(date, out info) Non-throwing variant, false when out of range
GetHolidays(year) Holidays, make-up holidays and adjusted days off of a year (weekends excluded)
GetMakeupWorkdays(year) Make-up Saturdays of a year
GetNextWorkday(date) / GetPreviousWorkday(date) Next / previous workday (exclusive)
CountWorkdays(from, to) Workday count, both ends inclusive
GetHolidayPeriods(year) Consecutive 3+ day breaks overlapping the year (cross-year periods untruncated)
MinDate / MaxDate / SupportedYears Data coverage

Data policy

  • Source: DGPA (行政院人事行政總處) official "government office calendar" — the calendar for government agencies, which is also the de-facto business calendar in Taiwan.
  • Coverage: 2017-01-01 to 2027-12-31. Each year's data is annotated with its source in the repository.
  • Yearly updates: DGPA announces next year's calendar around May–June; a new minor version ships after each announcement.
  • Not included: typhoon days / ad-hoc suspensions (not nationwide-uniform), observances that are not days off, and pre-2025 Labor Day (which applied to workers but not government offices — this package models the government calendar).

Ozakboy.TaiwanKit series

Package Description
Ozakboy.TaiwanKit.TwIdValidator Taiwan ID / BAN / mobile number validation
Ozakboy.TaiwanKit.TaiwanHolidays Taiwan national holidays / make-up workday queries (this package)
Ozakboy.TaiwanKit.Ganzhi.NET Lunar calendar / solar terms / Ganzhi conversion
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 103 7/5/2026
1.0.0 91 7/4/2026

Added the Ozakboy.TaiwanKit series logo as the NuGet package icon and README header. Changelog: https://github.com/ozakboy/Ozakboy.TaiwanKit.TaiwanHolidays/blob/main/docs/en/changelog.md