Enrico Service is a free service written in PHP providing public holidays for several countries. This library is a .NET wrapper to the Enrico Service, based on .NET standard 1.4.
- Get public holidays on various countries including USA, HK, China, etc through Enrico Service
- Determine if the given day is a holiday to the country
Enrico Service has provided us a great free service to query holidays from various countries. Please give your love by making a donation to them if you find the service useful =)
- .NET Core 1.0
- .NET Framework 4.6.1 or above
- Xamarin.iOS
- Xamarin.Android
- Universal Windows Platform
You can find the package through Nuget
PM> Install-Package EnricoApi
var list = await Enrico.GetPublicHolidaysForYearAsync(2016, Country.HongKong);
foreach (var holiday in list)
{
Console.WriteLine($"Date: {holiday.DateTime}, Local Name: {holiday.LocalName}, English Name: {holiday.EnglishName}");
}
var list = await Enrico.GetPublicHolidaysForMonthAsync(2016, 1, Country.HongKong);
foreach (var holiday in list)
{
Console.WriteLine($"Date: {holiday.DateTime}, Local Name: {holiday.LocalName}, English Name: {holiday.EnglishName}");
}
var list = await Enrico.GetPublicHolidaysForDateRangeAsync(new DateTime(2016, 1, 1), DateTime.Now, Country.HongKong);
foreach (var holiday in list)
{
Console.WriteLine($"Date: {holiday.DateTime}, Local Name: {holiday.LocalName}, English Name: {holiday.EnglishName}");
}
bool isHoliday = await Enrico.IsPublicHolidayAsync(new DateTime(2016, 1, 1), Country.HongKong);
This library is under MIT License