12/31/1999 US
Important specifications
US
Description
Code
var publicHolidays = DateSystem.GetPublicHoliday("US", 2000);
foreach (var publicHoliday in publicHolidays)
{
Console.WriteLine( publicHoliday.Name + " " + publicHoliday.Date.ToShortDateString());
}
Console.WriteLine(
DateSystem.IsPublicHoliday(DateTime.Parse("12/31/1999"),CountryCode.US));
Output
New Year's Day 12/31/1999 Martin Luther King, Jr. Day 1/17/2000 Presidents' Day 2/21/2000 Memorial Day 5/29/2000 Independence Day 7/4/2000 Labour Day 9/4/2000 Columbus Day 10/9/2000 Veterans Day 11/10/2000 Thanksgiving Day 11/23/2000 Christmas Day 12/25/2000 False Press any key to continue . . .
12/31/1999 is a public holiday for the year 2000 but when you call IsPublicHoliday(DateTime.Parse("12/31/1999"),CountryCode.US)); it returns false. This is because the Holiday is for the year 2000 not 1999
I have add a new unit test following countries have an issue MX/PR/US. I'll check that out more closely over the next few days.
If you are from america? What is the right solution? Add 2 entrys in the calendar?
For example Fr | 30. Dez | New Year's Eve observed Sa | 31. Dez | New Year's Eve
https://www.law.cornell.edu/uscode/text/5/6103