Here are some pistons to run nightly that detect if today is a U.S. Holiday. They also find the previous and next holiday. Finally, they also calculate some floating holidays like Easter and the Jewish holidays on the first of the year.
The “Holidays” piston is the primary piston and it does not self-trigger. It must be run nightly from another piston. I have included my “Midnight Updates” piston as an example.
Just to be safe, I set them up to wait for the previous one to finish before running the next one.
Also run them at 12:01am or later (if you use midnight exactly, sometimes they run too soon and it is not the next day yet!).
They require these global variables:
string @HolidayChristmas = Christmas Day
string @HolidayColumbus = Columbus Day
string @HolidayEaster = Easter Day
date @HolidayEasterDate
string @HolidayElection = Election Day
string @HolidayHalloween = Halloween
string @HolidayIndependence = Independence Day
string @HolidayLabor = Labor Day
string @HolidayMLK = Dr. Martin Luther King Day
string @HolidayMemorial = Memorial Day
string @HolidayNewYears = New Year's Day
string @HolidayNext
date @HolidayNextDate
integer @HolidayNextDaysAway
string @HolidayPassover = Passover
date @HolidayPassoverDate
string @HolidayPresidentsDay = President's Day
string @HolidayPrevious
date @HolidayPreviousDate
integer @HolidayPreviousDaysPassed
string @HolidayRoshHashanah = Rosh Hashanah
date @HolidayRoshHashanahDate
string @HolidayStPatricks = St. Patrick's Day
string @HolidayThanksgiving = Thanksgiving Day
string @HolidayToday
boolean @HolidayTodayIsFederal = false
boolean @HolidayTodayIsObserved = false
string @HolidayValentinesDay = Valentine's Day
string @HolidayVeterans = Veterans Day
string @HolidayYomKippur = Yom Kippur
date @HolidayYomKippurDate