Nager.Date
2.8.2
Prefix Reserved
dotnet add package Nager.Date --version 2.8.2
NuGet\Install-Package Nager.Date -Version 2.8.2
<PackageReference Include="Nager.Date" Version="2.8.2" />
<PackageVersion Include="Nager.Date" Version="2.8.2" />
<PackageReference Include="Nager.Date" />
paket add Nager.Date --version 2.8.2
#r "nuget: Nager.Date, 2.8.2"
#addin nuget:?package=Nager.Date&version=2.8.2
#tool nuget:?package=Nager.Date&version=2.8.2
Nager.Date
Nager.Date is a popular project for querying holidays, we currently support for over 100 countries.
Country Support
The list of supported countries can be found here
Examples
Set License Key
HolidaySystem.LicenseKey = "TheLicenseKey";
Get all holidays of a country and 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 all 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("Is a public holiday");
}
Checks if the given date falls on a weekend day
var date = new DateTime(2024, 1, 1);
if (WeekendSystem.IsWeekend(date, CountryCode.DE))
{
Console.WriteLine("The date is in the weekend");
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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. |
.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 is compatible. 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.7.2
- Nager.LicenseSystem (>= 1.1.0)
-
.NETStandard 2.0
- Nager.LicenseSystem (>= 1.1.0)
-
net6.0
- Nager.LicenseSystem (>= 1.1.0)
-
net8.0
- Nager.LicenseSystem (>= 1.1.0)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Nager.Date:
Package | Downloads |
---|---|
YellowCanary.IntervalQL
Package Description |
|
DateTimeConversionExtensions
A library of extension mehods to help convert times between time zones, add business days to a date time etc. Hat tip no Nager Date for calculating holidays and weekends for adding business days. Date time conversions use .Net's System.TimeZoneInfo. |
|
Brazil.DateTime
Brazil DateTime extension (Timezone convert, holidays, business days) |
|
MoreDateTime
A package to simplify dealing with .NET DateTime, DateOnly and TimeOnly objects |
|
Lava
Lava is a small Blazor components library |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Nager.Date:
Repository | Stars |
---|---|
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
|
Version | Downloads | Last updated | |
---|---|---|---|
2.8.2 | 13,890 | 20 days ago | |
2.8.1 | 3,578 | a month ago | |
2.8.0 | 31,891 | 2 months ago | |
2.7.5 | 20,671 | 3 months ago | |
2.7.4 | 3,070 | 3 months ago | |
2.7.3 | 345 | 3 months ago | |
2.7.2 | 11,790 | 4 months ago | |
2.7.1 | 61,608 | 5 months ago | |
2.7.0 | 5,967 | 5 months ago | |
2.6.7 | 5,667 | 6 months ago | |
2.6.6 | 796 | 6 months ago | |
2.6.5 | 51,959 | 6 months ago | |
2.6.4 | 1,391 | 6 months ago | |
2.6.3 | 530 | 6 months ago | |
2.6.2 | 6,933 | 6 months ago | |
2.6.1 | 2,018 | 6 months ago | |
2.6.0 | 166 | 6 months ago | |
2.5.3 | 4,199 | 6 months ago | |
2.5.2 | 3,058 | 7 months ago | |
2.5.1 | 7,240 | 7 months ago | |
2.5.0 | 6,517 | 8 months ago | |
2.4.1 | 38,766 | 9 months ago | |
2.4.0 | 34,860 | 4/28/2024 | |
2.3.1 | 5,845 | 4/14/2024 | |
2.3.0 | 39,349 | 3/28/2024 | |
2.2.2 | 3,059 | 3/21/2024 | |
2.2.1 | 401 | 3/19/2024 | |
2.2.0 | 2,427 | 3/17/2024 | |
2.1.0 | 518 | 3/13/2024 | |
2.0.2 | 400 | 3/8/2024 | |
2.0.1 | 190 | 3/8/2024 | |
2.0.0 | 1,330 | 3/7/2024 | |
1.48.0 | 94,611 | 2/12/2024 | |
1.47.1 | 60,171 | 12/13/2023 | |
1.47.0 | 9,161 | 11/21/2023 | |
1.46.0 | 29,607 | 10/10/2023 | |
1.45.0 | 20,678 | 8/27/2023 | |
1.44.0 | 904 | 8/22/2023 | |
1.43.0 | 37,256 | 6/26/2023 | |
1.42.0 | 35,689 | 4/24/2023 | |
1.41.0 | 6,882 | 4/18/2023 | |
1.40.0 | 2,668,336 | 3/5/2023 | |
1.39.0 | 7,601 | 2/11/2023 | |
1.38.0 | 41,515 | 1/11/2023 | |
1.37.0 | 75,530 | 11/9/2022 | |
1.36.4 | 25,077 | 10/4/2022 | |
1.36.3 | 1,177 | 9/30/2022 | |
1.36.2 | 8,082 | 9/19/2022 | |
1.36.1 | 5,817 | 9/13/2022 | |
1.36.0 | 4,432 | 9/11/2022 | |
1.35.0 | 58,661 | 6/1/2022 | |
1.34.1 | 33,879 | 5/2/2022 | |
1.33.1 | 848,515 | 3/16/2022 | |
1.32.0 | 342,625 | 1/22/2022 | |
1.30.0 | 380,849 | 9/30/2021 | |
1.29.2 | 625,377 | 6/21/2021 | |
1.29.0 | 91,531 | 5/18/2021 | |
1.28.2 | 244,720 | 3/8/2021 | |
1.28.1 | 283,529 | 2/17/2021 | |
1.26.6 | 247,318 | 11/23/2020 | |
1.26.4 | 174,779 | 10/22/2020 | |
1.26.3 | 121,943 | 8/26/2020 | |
1.26.2 | 99,408 | 7/1/2020 | |
1.26.0 | 3,470,852 | 5/29/2020 | |
1.25.11 | 195,747 | 4/29/2020 | |
1.25.10 | 505,083 | 1/14/2020 | |
1.25.8 | 99,755 | 11/24/2019 | |
1.25.7 | 64,763 | 10/30/2019 | |
1.25.6 | 243,695 | 9/2/2019 | |
1.25.4 | 21,961 | 8/9/2019 | |
1.25.3 | 125,619 | 6/25/2019 | |
1.24.9 | 110,073 | 4/22/2019 | |
1.24.8 | 31,137 | 4/2/2019 | |
1.24.7 | 41,021 | 3/5/2019 | |
1.24.5 | 108,773 | 2/19/2019 | |
1.24.0 | 67,048 | 1/12/2019 | |
1.22.4 | 40,175 | 12/14/2018 | |
1.22.3 | 89,753 | 10/18/2018 | |
1.21.0 | 85,133 | 8/15/2018 | |
1.20.3 | 73,691 | 6/22/2018 | |
1.9.0 | 64,313 | 5/18/2017 | |
1.6.0 | 4,524 | 3/26/2017 | |
1.0.18 | 4,160 | 1/25/2017 | |
1.0.7 | 2,343 | 5/14/2016 | |
1.0.3 | 1,719 | 8/15/2014 |
A changelog is available at https://github.com/nager/Nager.Date/releases