Understanding public holidays
Fixed dates, computed dates, observed dates.
The three types of public holiday, the Easter algorithm that drives Christian floating dates, and why "observed" matters more than "actual".
Three categories.
Fixed dates: 1 January, 25 December, US 4 July, French 14 July. The same date every year regardless of weekday. Computed floating dates: Easter, Eid, Lunar New Year, Diwali, Thanksgiving (US: fourth Thursday of November; Canada: second Monday of October). The date shifts each year by formula. Observed dates: when a fixed date falls on a weekend, many countries shift the public holiday to the nearest workday — the observed date isn't the actual date.
Easter, the famous algorithm.
Easter is the first Sunday after the first ecclesiastical full moon on or after 21 March. The "ecclesiastical full moon" is a table-based approximation, not the astronomical one. The Gauss-Butcher algorithm produces the date from year alone — ten lines of arithmetic, no astronomy required. Every floating Christian holiday (Good Friday, Pentecost, Ascension, Ash Wednesday) is then offset from Easter. The algorithm landed in the Gregorian reform of 1582 and hasn't changed.
Eid and the lunar calendar.
Eid al-Fitr (end of Ramadan) and Eid al-Adha follow the Islamic lunar calendar — months track moon phases, year is ~354 days (11 days shorter than solar). Dates shift earlier each Gregorian year. Compounding complexity: the exact start depends on local moon-sighting traditions, which vary by country. A government-published calendar is the source of truth; algorithmic predictions agree only to ±1 day.
Observed-date rules.
UK: if a bank holiday falls on Saturday/Sunday, observe on Monday (or Tuesday if Monday is already a holiday). US: most federal holidays move to the nearest weekday (Saturday → Friday, Sunday → Monday). Some countries don't move (much of continental Europe — the holiday is just "lost" if it falls on a weekend). The "is today a holiday" question therefore depends on jurisdiction and on the specific rule for that year.
National vs regional.
Many countries have national holidays plus state/province/canton-level ones. Germany has 9 federal holidays plus 4-13 additional per Land; Swiss cantons each set their own; US states add Confederate Memorial Day, Cesar Chavez Day, Patriot's Day, depending on state. A "holiday calendar" needs to know what region applies; same date can be a workday in one canton and a holiday in the next.
The business reason to care.
SaaS support hours, payroll timing, banking settlement dates, shipping ETAs, recurring billing — all rely on accurate holiday data per region. Most teams use a library (date-holidays for JS, holidays for Python) backed by a maintained dataset. Hand-rolling the calendar from a government webpage works once; it doesn't survive the next year. The maintained dataset is the right tool.