When rendering a calendar's dayboxes or creating a company's HR days-off list, figuring out New Years Day, Christmas and Valentines Day are easy, but what about those floating holidays that depend on the instance of the Day in the Month?
This set of utilities gives a dev a lot of options plus offers protection against accidental weird arguments.
What's more, now all floating Holidays a company cares about are simply defined in a config file with month, instance number and/or flag for relative instance position from start or end of the month. (Non-floating holidays are likewise easily defined with a flag for specific Day number.)
Example test harness: start a Winform project, copy the class code to a class file, drop two textboxes on the form (txtDate and txtInstance), add a button to the form, double click on the button and paste this code in the stub: