BlogForms

The calendar said December. The HTML said April.

A published holiday page contained two different dates for the same day. Validating the visible date and weekday kept the wrong one out of the API.

While adding New Zealand's published holiday calendar, the source page had a small disagreement with itself. A person reading it saw Boxing Day observed on Monday, December 28. The HTML attribute attached to that date said April 28.

The published page contained this mismatch:

<time datetime="2026-04-28">Monday 28 December</time>

The attribute is convenient for a scraper. It already looks like the value an API wants to return: a year, month, and day in a standard format. April 28 is also a real date, so a check for valid date syntax would let it through.

The visible text provided another check. The calendar's 2026 heading, the month written in the cell, and the weekday all had to agree. Monday, December 28 does. April 28 doesn't match what the page tells its reader.

The holiday API gives December 28 as the observed holiday. The visible date and weekday agree on that answer. April 28 would have been a Tuesday.

The New Zealand calendar covers the published national holidays. Regional anniversary days are outside that coverage.

An official source is still the right starting point. It just doesn't remove the need to check what the document actually says. In this case, the text a person would read was more useful than the field intended for software.