Nager.Date 1.35.0 The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved

.NET 6.0 .NET Standard 2.0 .NET Framework 4.7.2
Install-Package Nager.Date -Version 1.35.0
dotnet add package Nager.Date --version 1.35.0
<PackageReference Include="Nager.Date" Version="1.35.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Nager.Date --version 1.35.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Nager.Date, 1.35.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. 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=1.35.0

// Install Nager.Date as a Cake Tool
#tool nuget:?package=Nager.Date&version=1.35.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Nager.Date

Nager.Date is a popular project to query holidays. We currently support over 100 countries.

Country Support

The list of supported countries can be found here

Examples

Get all publicHolidays of a country and year

var publicHolidays = DateSystem.GetPublicHolidays(2021, "DE");
foreach (var publicHoliday in publicHolidays)
{
    //publicHoliday...
    //publicHoliday.Date -> The date
    //publicHoliday.LocalName -> The local name
    //publicHoliday.Name -> The english name
    //publicHoliday.Fixed -> Is this public holiday every year on the same date
    //publicHoliday.Global -> Is this public holiday in every county (federal state)
    //publicHoliday.Counties -> Is the public holiday only valid for a special county ISO-3166-2 - Federal states
    //publicHoliday.Type -> Public, Bank, School, Authorities, Optional, Observance
}

Get all publicHolidays for a date range

var startDate = new DateTime(2016, 5, 1);
var endDate = new DateTime(2021, 5, 31);
var publicHolidays = DateSystem.GetPublicHolidays(startDate, endDate, CountryCode.DE);
foreach (var publicHoliday in publicHolidays)
{
	//publicHoliday...
}

Check if a date is a public holiday

var date = new DateTime(2021, 1, 1);
if (DateSystem.IsPublicHoliday(date, CountryCode.DE))
{
    Console.WriteLine("Is public holiday");
}

Check if a date is a weekend day

var date = new DateTime(2021, 1, 1);
if (DateSystem.IsWeekend(date, CountryCode.DE))
{
    Console.WriteLine("Is weekend");
}
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • net6.0

    • No dependencies.

NuGet packages (5)

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

MP_RPA_ReusableComponentPkg

A reusuable Component For Patient Statement and Billing

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Nager.Date:

Repository Stars
Material-Blazor/Material.Blazor
Lightweight Material Theme components for Blazor
Version Downloads Last updated
1.35.0 8,710 6/1/2022
1.34.1 10,584 5/2/2022
1.33.1 93,923 3/16/2022
1.32.0 54,357 1/22/2022
1.30.0 96,238 9/30/2021
1.29.2 165,030 6/21/2021
1.29.0 45,130 5/18/2021
1.28.2 165,497 3/8/2021
1.28.1 172,747 2/17/2021
1.26.6 60,755 11/23/2020
1.26.4 72,169 10/22/2020
1.26.3 74,776 8/26/2020
1.26.2 53,597 7/1/2020
1.26.0 75,587 5/29/2020
1.25.11 80,429 4/29/2020
1.25.10 378,732 1/14/2020
1.25.8 61,255 11/24/2019
1.25.7 31,394 10/30/2019
1.25.6 122,476 9/2/2019
1.25.4 18,337 8/9/2019
1.25.3 92,319 6/25/2019
1.24.9 71,976 4/22/2019
1.24.8 20,970 4/2/2019
1.24.7 25,048 3/5/2019
1.24.5 62,918 2/19/2019
1.24.0 65,526 1/12/2019
1.22.4 33,828 12/14/2018
1.22.3 71,259 10/18/2018
1.21.0 59,169 8/15/2018
1.20.3 37,474 6/22/2018
1.9.0 45,731 5/18/2017
1.6.0 3,679 3/26/2017
1.0.18 2,372 1/25/2017
1.0.7 1,838 5/14/2016
1.0.3 1,223 8/15/2014