Nager.Date is a Date/Calendar Framework for .NET
- Public holiday calculation for every year, based on easter sunday, country and county support. Supports more than 70 countries if your country is not supported, fork me, implement it and send me the pull request.
- Age calculation
http://publicholiday.azurewebsites.net
The package is available on nuget
PM> install-package Nager.Date
If this project help you reduce time to develop, you can give me a beer 🍺
var publicHolidays = DateSystem.GetPublicHoliday("DE", 2017);
foreach (var publicHoliday in publicHolidays)
{
//publicHoliday...
}
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...
}
var date = new DateTime(2017, 1, 1);
if (DateSystem.IsPublicHoliday(date, CountryCode.DE))
{
Console.WriteLine("Is public holiday");
}
var date = new DateTime(1900, 1, 1);
var age = DateSystem.GetAge(date);
- Åland
- Andorra
- Austria
- Belarus
- Belgium
- Bulgaria
- Croatia
- Cyprus
- Czech Republic
- Denmark
- Estonia
- Finland
- France
- Germany
- Greece
- Hungary
- Iceland
- Ireland
- Isle of Man
- Italy
- Jersey
- Latvia
- Liechtenstein
- Lithuania
- Luxembourg
- Malta
- Monaco
- Netherlands
- Norway
- Poland
- Portugal
- Romania
- Russia
- Slovakia
- Slovenia
- Spain
- Sweden
- Switzerland
- Turkey (without muslim based holidays)
- Ukraine
- United Kingdom
- China (without Qingming (Tomb-Sweeping Day))
- Kazakhstan
- Mongolia
- Russia
- Turkey (without muslim based holidays)
- Bahamas
- Belize
- Canada
- Costa Rica
- Cuba
- Dominican Republic
- El Salvador
- Guatemala
- Haiti
- Jamaica
- Mexico
- Nicaragua
- Panama
- Puerto Rico
- United States
- Argentina
- Bolivia
- Brazil
- Chile
- Colombia
- Ecuador
- French Guiana
- Guyana (without muslim based holidays and hindu based holidays)
- Honduras
- Paraguay
- Peru
- Suriname
- Uruguay
- Venezuela
- Greenland
- Botswana
- Madagascar
- Namibia
- South Africa
- Australia
- New Zealand
Mark Seemann - Simple holidays
Language | Project |
---|---|
PHP | yasumi |
JavaScript | date-holidays |
Java | jollyday |
.NET | Holiday |
Phyton | python-holidays |