metomi / isodatetime

:date: :watch: Python ISO 8601 date time parser and data model/manipulation utilities
GNU Lesser General Public License v3.0
37 stars 20 forks source link

Duration.to_weeks() loses precision #166

Closed MetRonnie closed 4 years ago

MetRonnie commented 4 years ago
>>> from metomi.isodatetime.data import Duration
>>> A = Duration(days=9)
>>> print(A.to_weeks().to_days())
P7D

Tested on 2.0.1

MetRonnie commented 4 years ago

This is not a bug; a duration in weeks has a maximum precision of 7 days in ISO 8601. I will update the docstring in the method to note this