Skip to main content
.NETFramework4.5.NETFramework4.6.1.NETStandard2.0.NETStandard2.1

Chinese holiday and adjusted-workday identification library with built-in annual holiday data and lunar festival support. Works fully offline and supports .NET Framework 4.5, .NET Standard 2.0/2.1 and modern .NET. 中国节假日与调休识别库,内置年度假期数据并支持农历节日判定,完全离线运行。

Published
Oct 24, 2026
today
Total Downloads
10.8K
10,763

Install

dotnet add package NewLife.Holiday --version 1.5.2026.1024
ProductVersions
.NET Standard
netstandard2.0netstandard2.1
Other
.NETFramework4.5.NETFramework4.6.1

README

NewLife.Holiday - Chinese Holiday Library

GitHub License NuGet Downloads NuGet test locales

Chinese holiday and adjusted-workday identification library with a built-in annual holiday database, lunar festival support and fully offline operation.

Installation

dotnet add package NewLife.Holiday

Quick start

using NewLife.Holiday;

var isHoliday = "2026-10-01".ToDateTime().IsChinaHoliday();

Guangxi March 3rd Festival:

using NewLife.Holiday;

var isHoliday = "2026-04-18".ToDateTime().IsGuangxiHoliday();

Localized holiday names

HolidayInfo.DisplayName returns the holiday name in the current UI language, while Name keeps the original Chinese source:

var info = HolidayExtensions.China.Query("2026-02-15".ToDateTime()).FirstOrDefault();
Console.WriteLine(info?.DisplayName); // Spring Festival

The word list ships 11 languages (English, Simplified Chinese, Traditional Chinese, Spanish, German, Japanese, French, Portuguese, Russian, Korean and Arabic); unsupported languages fall back to Chinese.

Logging

ChinaHoliday and GuangxiHoliday accept an ILog in the constructor. The default is a null logger, so the library stays silent unless you opt in:

using NewLife.Log;
using NewLife.Holiday;

XTrace.UseConsole();
var holiday = new ChinaHoliday(XTrace.Log);
// [ChinaHoliday]Loaded 91 holiday records from 7 embedded resources for [China].

Log messages are translated with the current log language (Localization.LogCulture, falling back to Localization.Culture).

Documentation

License

MIT License © 2002-2026 NewLife Team

GitHub | Website

Changes from Previous Version

No structural changes between v1.5.2026.1024-beta0312 and v1.5.2026.1024.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 4 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.