Changelog
All notable changes to Vali-Holiday are documented here. Follows Keep a Changelog and Semantic Versioning.
[1.1.0]
Added
IValiHoliday.IsHoliday(DateTime, params string[])(ANY semantics) andIsHolidayInAll(DateTime, params string[])(ALL semantics) — multi-country holiday checks in a single call.HolidayInfo.TryToDateTime(int year, out DateTime result)— safe(Month, Day, year)conversion that returnsfalseinstead of throwing for Feb 29 in a non-leap year.ObservedRuleenum andIHolidayProvider.GetObservedDate(HolidayInfo, int)/IValiHoliday.GetObservedHoliday(DateTime, string)— official weekend-shift ("observed"/"substitute" day) resolution, implemented for USA (Saturday → previous Friday, Sunday → following Monday) and United Kingdom (weekend → next available weekday, with coordinated Christmas Day/Boxing Day collision handling). No other provider declares a rule in this release.
Changed
IsHoliday(DateTime, params string[])andIsHolidayInAll(DateTime, params string[])now throwArgumentNullExceptioninstead ofNullReferenceExceptionwhen called with anullarray.HolidayInfois now asealed record(previously asealed class) — adds structural equality;ToString()format is unchanged.Namesis still compared by reference, since records do not deep-compare collections.- Moved
UsaHolidayProvider.cs/CanadaHolidayProvider.cstoProviders/NorthAmerica/andAustraliaHolidayProvider.cstoProviders/Oceania/, matching their already-declared namespaces (no namespace or behavior change). - Added
net10.0target.
Fixed
BaseHolidayProvider.GetHolidaysInRangeandValiHoliday.GetNextHolidayWithYear/GetPreviousHolidayWithYearnow share a single Feb-29/non-leap-year guard (viaHolidayInfo.TryToDateTime) instead of three independently-written checks.
[1.0.0] — 2025-07-01
Added
HolidayInfomodel with multilingual support: Spanish (es), English (en), Portuguese (pt), French (fr), German (de).IHolidayProviderinterface andBaseHolidayProviderabstract base class.EasterCalculatorusing the Gaussian algorithm, supporting 9 Easter-based movable holidays.- Country providers for 35+ countries across Latin America and Europe.
HolidayProviderFactorywithCreateAll(),CreateLatinAmerica(), andCreateEurope()factory methods.ValiHolidaywith provider management:Register,Supports,SupportedCountries.- Holiday queries:
IsHoliday,GetHolidays,For. - Navigation helpers:
GetNextHolidayWithYear,GetPreviousHolidayWithYear. - Weekend helpers:
IsLongWeekend,HolidaysThisMonth. AddValiHoliday()extension method forIServiceCollectionDI registration.
Performance
BaseHolidayProvider.IsHolidayuses an O(1)HashSetcache per year to avoid repeated linear scans when checking the same year multiple times.