isodatetime
isodatetime copied to clipboard
Traceback when converting truncated week date, with year of decade, to calendar date
>>> a = TimePoint(year=1, week_of_year=2, truncated=True, truncated_property=year_of_decade)
>>> a
<metomi.isodatetime.data.TimePoint: -1-W02>
>>> a.to_calendar_date()
...
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
I think converting to a calendar date (i.e. month of year and day of month, instead of week of year and day of week) is not possible for a time point with truncated year, because it depends on the exact year. We should raise a ValueError or BadInputError with a more useful error message.