[ { "name": "February 2024 has 29 days because 2024 is a leap year", "args": ["2024-02-15"], "expect": { "start": "2024-02-01", "end": "2024-02-29", "days": 29 } }, { "name": "the leap day itself resolves to the same month", "args": ["2024-02-29"], "expect": { "start": "2024-02-01", "end": "2024-02-29", "days": 29 } }, { "name": "February 1900 had 28 days: a century year is not a leap year", "args": ["1900-02-15"], "expect": { "start": "1900-02-01", "end": "1900-02-28", "days": 28 } }, { "name": "February 2000 had 29 days: divisible by 400, so it was", "args": ["2000-02-15"], "expect": { "start": "2000-02-01", "end": "2000-02-29", "days": 29 } }, { "name": "February 2100 will have 28 days, the next century exception", "args": ["2100-02-15"], "expect": { "start": "2100-02-01", "end": "2100-02-28", "days": 28 } }, { "name": "February 2026 is an ordinary 28 days", "args": ["2026-02-15"], "expect": { "start": "2026-02-01", "end": "2026-02-28", "days": 28 } }, { "name": "January has 31 days", "args": ["2026-01-15"], "expect": { "start": "2026-01-01", "end": "2026-01-31", "days": 31 } }, { "name": "April has 30 days", "args": ["2026-04-15"], "expect": { "start": "2026-04-01", "end": "2026-04-30", "days": 30 } }, { "name": "the 1st of a month is its own start", "args": ["2026-09-01"], "expect": { "start": "2026-09-01", "end": "2026-09-30", "days": 30 } }, { "name": "the last day of a month is its own end", "args": ["2026-09-30"], "expect": { "start": "2026-09-01", "end": "2026-09-30", "days": 30 } }, { "name": "December ends the year on the 31st, not on 1 January", "args": ["2026-12-25"], "expect": { "start": "2026-12-01", "end": "2026-12-31", "days": 31 } }, { "name": "December 1900, well before the 1970 epoch", "args": ["1900-12-31"], "expect": { "start": "1900-12-01", "end": "1900-12-31", "days": 31 } }, { "name": "the first supported month", "args": ["0001-01-01"], "expect": { "start": "0001-01-01", "end": "0001-01-31", "days": 31 } }, { "name": "the last supported month", "args": ["9999-12-31"], "expect": { "start": "9999-12-01", "end": "9999-12-31", "days": 31 } }, { "name": "a slash-separated date is an error, not a guess", "args": ["15/02/2024"], "expectError": "is not an ISO date" }, { "name": "a year-month with no day is an error", "args": ["2026-02"], "expectError": "is not an ISO date" }, { "name": "29 February 1900 never existed", "args": ["1900-02-29"], "expectError": "is not a real calendar date" }, { "name": "31 September never exists", "args": ["2026-09-31"], "expectError": "is not a real calendar date" }, { "name": "month 13 is rejected", "args": ["2026-13-01"], "expectError": "is not a real calendar date" } ]