NewLife.Holiday
1.5.2026.1024
See the version list below for details.
dotnet add package NewLife.Holiday --version 1.5.2026.1024
NuGet\Install-Package NewLife.Holiday -Version 1.5.2026.1024
<PackageReference Include="NewLife.Holiday" Version="1.5.2026.1024" />
<PackageVersion Include="NewLife.Holiday" Version="1.5.2026.1024" />
<PackageReference Include="NewLife.Holiday" />
paket add NewLife.Holiday --version 1.5.2026.1024
#r "nuget: NewLife.Holiday, 1.5.2026.1024"
#:package NewLife.Holiday@1.5.2026.1024
#addin nuget:?package=NewLife.Holiday&version=1.5.2026.1024
#tool nuget:?package=NewLife.Holiday&version=1.5.2026.1024
NewLife.Holiday - Chinese Holiday Library
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
| Product | Versions 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 was computed. 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 was computed. 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 was computed. 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 | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 is compatible. 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. |
-
.NETFramework 4.5
- NewLife.Core (>= 12.0.2026.1024)
-
.NETFramework 4.6.1
- NewLife.Core (>= 12.0.2026.1024)
-
.NETStandard 2.0
- NewLife.Core (>= 12.0.2026.1024)
-
.NETStandard 2.1
- NewLife.Core (>= 12.0.2026.1024)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on NewLife.Holiday:
| Package | Downloads |
|---|---|
|
NewLife.ChatAI
集对话前端、统一 AI 网关、Agent 平台于一身的完整 AI 应用。支持多轮对话、流式输出、函数调用、图像生成、会话管理与使用量统计 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.2026.1107-beta0423 | 80 | 11/7/2026 |
| 1.5.2026.1024 | 323 | 10/24/2026 |
| 1.5.2026.1024-beta0312 | 98 | 10/24/2026 |
| 1.4.2026.1022-beta0136 | 100 | 10/22/2026 |
| 1.4.2026.1019-beta1205 | 129 | 10/19/2026 |
| 1.4.2026.1019-beta0441 | 97 | 10/19/2026 |
| 1.4.2026.1018-beta1723 | 95 | 10/18/2026 |
| 1.4.2026.1017-beta1409 | 89 | 10/17/2026 |
| 1.4.2026.1016-beta1413 | 101 | 10/16/2026 |
| 1.4.2026.302-beta0609 | 192 | 3/2/2026 |
| 1.4.2026.301-beta0612 | 138 | 3/1/2026 |
| 1.4.2026.211-beta0609 | 138 | 2/11/2026 |
| 1.4.2026.206 | 1,411 | 2/6/2026 |
| 1.4.2026.206-beta1417 | 139 | 2/6/2026 |
| 1.3.2026.206-beta1252 | 147 | 2/6/2026 |
| 1.3.2026.114-beta0610 | 153 | 1/14/2026 |
| 1.3.2026.102-beta1643 | 153 | 1/2/2026 |
| 1.3.2025.1112-beta0613 | 357 | 11/12/2025 |
| 1.3.2025.1105-beta0315 | 260 | 11/5/2025 |
| 1.3.2025.1001 | 269 | 10/1/2025 |
新增假期名称与运行时消息的 11 语种本地化,支持运行时注册词表覆盖;新增 ChinaHoliday/GuangxiHoliday 日志对象注入与本地化前缀日志,默认保持静默;加载不到嵌入资源时按警告输出,避免分类拼错静默降级;修复多天假期起始日重复返回;节气计算优化;新增 Android/iOS 移动端与 NativeAOT 冒烟,单元测试扩充至 138 例;升级 NewLife.Core 至 12.0.2026.1024