Skip to content

mauricioribeiro/Nager.Date

 
 

Repository files navigation

GitHub Release

#Nager.Date

Public holiday calculation for every year, based on easter sunday, country and county support. If your country is not supported, fork me, implement it and send me the pull request.

###Demo Website http://publicholiday.azurewebsites.net

###nuget The package is available on nuget

PM> install-package Nager.Date

###Exampels

####Get all publicHolidays of a country and year

var publicHolidays = DateSystem.GetPublicHoliday("DE", 2017);
foreach (var publicHoliday in publicHolidays)
{
	//publicHoliday...
}

####Get all publicHolidays for a date range

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

####Check if a date a public holiday

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

###Country Support ####Europe

  • Austria
  • Belarus
  • Belgium
  • Bulgaria
  • Croatia
  • Cyprus
  • Czech Republic
  • Denmark
  • Estonia
  • Finland
  • France
  • Germany
  • Greece
  • Hungary
  • Ireland
  • Italy
  • Latvia
  • Liechtenstein
  • Lithuania
  • Luxembourg
  • Malta
  • Netherlands
  • Norway
  • Poland
  • Portugal
  • Romania
  • Russia
  • Slovakia
  • Slovenia
  • Spain
  • Sweden
  • Switzerland
  • United Kingdom

####North America

  • Canada
  • United States

####Atlantic

  • Greenland

####Africa

  • Madagascar
  • South Africa

####Australia & Pacific

  • New Zealand

Packages

No packages published

Languages

  • C# 93.0%
  • JavaScript 6.7%
  • Other 0.3%