Parsing ordinal dates should only allow day 366 for leap years

Issue #14 resolved
Brandon Nielsen repo owner created an issue

Currently, allowing day 366 succeeds for all dates.

>>> print aniso8601.parse_date('1981366')
1982-01-01
>>> print aniso8601.parse_date('1980366')
1980-12-31

The first should raise a ValueError. From Wikipedia on ISO 8601 and ordinal dates: "[YYYY] indicates a year. [DDD] is the day of that year, from 001 through 365 (366 in leap years)"

Comments (1)

  1. Log in to comment