Lager.Date
2.16.1
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.8.1
This package targets .NET Framework 4.8.1. The package is compatible with this framework or higher.
dotnet add package Lager.Date --version 2.16.1
NuGet\Install-Package Lager.Date -Version 2.16.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="Lager.Date" Version="2.16.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lager.Date" Version="2.16.1" />
<PackageReference Include="Lager.Date" />
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 Lager.Date --version 2.16.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Lager.Date, 2.16.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 Lager.Date@2.16.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=Lager.Date&version=2.16.1
#tool nuget:?package=Lager.Date&version=2.16.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Nager.Date
Nager.Date is a comprehensive .NET library for querying public and federal holidays, supporting over 110 countries worldwide. It provides native and English translations and supports country subdivisions (federal states) according to ISO 3166-2 standards.
Supported Countries
You can see the full list of supported countries here
Features
- Query public, federal, bank, school, and optional holidays (availability may vary by country).
- Support for country subdivisions (federal states, provinces).
- Native and English translations for holiday names.
- Retrieve holidays by year or date range.
- Check if a specific date is a public holiday.
- Weekend detection for any country.
Getting Started
Set License Key
HolidaySystem.LicenseKey = "TheLicenseKey";
Check License
var licenseKey = "TheLicenseKey";
var licenseInfo = Nager.Date.License.LicenseHelper.CheckLicenseKey(licenseKey);
if (licenseInfo is null)
{
//license key invalid
return;
}
if (licenseInfo.ValidUntil < DateTime.Today)
{
//license key expired
return;
}
Get Holidays for a Year
var holidays = HolidaySystem.GetHolidays(2024, "DE");
foreach (var holiday in holidays)
{
Console.WriteLine($"{holiday.Date:yyyy-MM-dd} - {holiday.EnglishName}");
//holiday...
//holiday.Date -> The date
//holiday.ObservedDate -> The date on which the holiday is observed
//holiday.LocalName -> The local name
//holiday.EnglishName -> The english name
//holiday.NationalHoliday -> Is this holiday in every county (federal state)
//holiday.SubdivisionCodes -> Is the holiday only valid for a special county ISO-3166-2 - Federal states
//holiday.HolidayTypes -> Public, Bank, School, Authorities, Optional, Observance
}
Get Holidays for a Date Range
var startDate = new DateTime(2016, 5, 1);
var endDate = new DateTime(2024, 5, 31);
var holidays = HolidaySystem.GetHolidays(startDate, endDate, CountryCode.DE);
foreach (var holiday in holidays)
{
//holiday...
}
Check if a date is a public holiday
var date = new DateTime(2024, 1, 1);
if (HolidaySystem.IsPublicHoliday(date, CountryCode.DE))
{
Console.WriteLine("This date is a public holiday.");
}
Check if a Date is on a Weekend
var date = new DateTime(2024, 1, 1);
if (WeekendSystem.IsWeekend(date, CountryCode.DE))
{
Console.WriteLine("The date falls on a weekend.");
}
| 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 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 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 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 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 is compatible. |
| 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.
-
.NETFramework 4.8.1
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
-
net8.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 |
|---|---|---|
| 2.16.1 | 115 | 3/9/2026 |
A changelog is available at https://github.com/nager/Nager.Date/releases