Each rule holds across eras
All 12 scenarios hold
The classic introductory example is the Gregorian leap year rules. The first rule below gives one example year per rule. The second uses value sets, and shows that each rule holds across eras.
A leap year is a year with an extra day, February 29. The extra day keeps the calendar year aligned with Earth's orbit around the Sun.
A normal year has 365 days. Earth takes about 365.2422 days to orbit the Sun. To account for that extra fraction, we add one day every four years. Years divisible by 100 are an exception: they are not leap years, unless they are also divisible by 400.
expected outcome
broken scenario
| Scenario | Year | Is Leap Year? |
|---|---|---|
| Not divisible by 4 |
| No |
| Divisible by 4 |
| Yes |
| Divisible by 100 but not by 400 |
| No |
| Divisible by 400 |
| Yes |