The US federal holiday for 2028 New Year's Day falls in 2027
January 1, 2028 is a Saturday. Under the US federal rule, a holiday that lands on a Saturday is observed on the Friday before. So the day off for New Year's 2028 is Friday, December 31, 2027. That one date broke an assu
January 1, 2028 is a Saturday. Under the US federal rule, a holiday that lands on a Saturday is observed on the Friday before. So the day off for New Year's 2028 is Friday, December 31, 2027.
That one date broke an assumption in my business-days code: "this year's holidays happen in this year."
Where it shows up
OPM publishes holiday schedules by year. Its 2028 table starts with "Friday, December 31 * New Year's Day", and that Friday falls in 2027. If you build a holiday list by looping over one year's rules and keeping dates inside that year, you drop it.
The result is off by one. My calculator counts 249 US federal business days in 2027. That year has 12 weekday federal holidays, not the usual 11. It gets two New Year's days: Friday, January 1, 2027 for its own, and Friday, December 31, 2027 for 2028's.
The fix
When I generate holidays for year Y, I also check January 1 of year Y+1:
// if next year's Jan 1 is a Saturday, its observed day is Dec 31 of this year
const nextNY = new Date(Date.UTC(year + 1, 0, 1));
if (nextNY.getUTCDay() === 6) {
list.push(["New Year's Day (observed)", new Date(Date.UTC(year, 11, 31))]);
}
// and drop this year's Jan 1 holiday if it was moved back into last year
return list.filter(([, d]) => d.getUTCFullYear() === year);
The filter matters too. In 2022, January 1 was also a Saturday, so the observed day was December 31, 2021. It belongs in 2021's count, not 2022's.
The UK does it the other way
England and Wales move a weekend bank holiday forward, to the next weekday. In late 2027 that gives:
- Christmas Day (Saturday) is observed Monday, December 27
- Boxing Day (Sunday) is observed Tuesday, December 28
- New Year's Day 2028 (Saturday) is observed Monday, January 3, 2028
I checked those against the GOV.UK bank holidays feed, and my rules produce the same dates. One country pulls the day back across the year line and the other pushes it forward, so "add 1 if Sunday" is not a universal rule.
What I took from it
- Build holiday maps for a range of years, not one year at a time, and filter afterward.
- Test the boundary years on purpose. 2021/2022 and 2027/2028 are the ones to keep in your test file.
- Compare against the official feed when one exists. GOV.UK publishes JSON; OPM publishes a table per year.
If you want to check a date range without writing the code, the calculator I built shows which holidays it skipped: Business Days Calculator. The yearly totals by country are here: Business days in a year.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.