Nager.Date 2.3.1

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Nager.Date --version 2.3.1
NuGet\Install-Package Nager.Date -Version 2.3.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="Nager.Date" Version="2.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Nager.Date --version 2.3.1
#r "nuget: Nager.Date, 2.3.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.
// Install Nager.Date as a Cake Addin
#addin nuget:?package=Nager.Date&version=2.3.1

// Install Nager.Date as a Cake Tool
#tool nuget:?package=Nager.Date&version=2.3.1

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.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 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. 
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

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)

Lava

Lava is a small Blazor components library

MoreDateTime

A package to simplify dealing with .NET DateTime, DateOnly and TimeOnly objects

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.3.1 817 4/14/2024
2.3.0 8,812 3/28/2024
2.2.2 1,275 3/21/2024
2.2.1 310 3/19/2024
2.2.0 1,437 3/17/2024
2.1.0 437 3/13/2024
2.0.2 311 3/8/2024
2.0.1 104 3/8/2024
2.0.0 1,148 3/7/2024
1.48.0 13,242 2/12/2024
1.47.1 17,714 12/13/2023
1.47.0 5,042 11/21/2023
1.46.0 17,476 10/10/2023
1.45.0 16,157 8/27/2023
1.44.0 818 8/22/2023
1.43.0 25,816 6/26/2023
1.42.0 25,764 4/24/2023
1.41.0 5,134 4/18/2023
1.40.0 14,363 3/5/2023
1.39.0 5,722 2/11/2023
1.38.0 38,558 1/11/2023
1.37.0 51,060 11/9/2022
1.36.4 19,519 10/4/2022
1.36.3 1,104 9/30/2022
1.36.2 6,982 9/19/2022
1.36.1 5,662 9/13/2022
1.36.0 3,798 9/11/2022
1.35.0 36,056 6/1/2022
1.34.1 31,914 5/2/2022
1.33.1 590,328 3/16/2022
1.32.0 230,189 1/22/2022
1.30.0 281,247 9/30/2021
1.29.2 451,783 6/21/2021
1.29.0 76,941 5/18/2021
1.28.2 217,294 3/8/2021
1.28.1 257,377 2/17/2021
1.26.6 177,117 11/23/2020
1.26.4 128,821 10/22/2020
1.26.3 108,458 8/26/2020
1.26.2 82,715 7/1/2020
1.26.0 589,023 5/29/2020
1.25.11 158,186 4/29/2020
1.25.10 472,750 1/14/2020
1.25.8 83,865 11/24/2019
1.25.7 52,377 10/30/2019
1.25.6 172,695 9/2/2019
1.25.4 20,525 8/9/2019
1.25.3 113,752 6/25/2019
1.24.9 97,702 4/22/2019
1.24.8 29,578 4/2/2019
1.24.7 36,282 3/5/2019
1.24.5 108,542 2/19/2019
1.24.0 65,939 1/12/2019
1.22.4 37,968 12/14/2018
1.22.3 85,935 10/18/2018
1.21.0 78,219 8/15/2018
1.20.3 63,596 6/22/2018
1.9.0 58,245 5/18/2017
1.6.0 4,378 3/26/2017
1.0.18 3,553 1/25/2017
1.0.7 2,199 5/14/2016
1.0.3 1,565 8/15/2014

A changelog is available at https://github.com/nager/Nager.Date/releases