year, month, day -> ordinal, considering 01-Jan-0001 as day 1.
(year, month, day)
| 66 | return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year)) |
| 67 | |
| 68 | def _ymd2ord(year, month, day): |
| 69 | "year, month, day -> ordinal, considering 01-Jan-0001 as day 1." |
| 70 | assert 1 <= month <= 12, f"month must be in 1..12, not {month}" |
| 71 | dim = _days_in_month(year, month) |
| 72 | assert 1 <= day <= dim, f"day must be in 1..{dim}, not {day}" |
| 73 | return (_days_before_year(year) + |
| 74 | _days_before_month(year, month) + |
| 75 | day) |
| 76 | |
| 77 | _DI400Y = _days_before_year(401) # number of days in 400 years |
| 78 | _DI100Y = _days_before_year(101) # " " " " 100 " |
no test coverage detected
searching dependent graphs…