fix utils.datetime.format.to_pretty_time typehinting
This commit is contained in:
parent
eb60e09a23
commit
9ce21a30eb
1 changed files with 3 additions and 2 deletions
|
@ -61,8 +61,9 @@ def to_pretty_time(total_seconds: int, max_units: int=UNIT_MINIMUM,
|
|||
later += mod
|
||||
else:
|
||||
later -= mod
|
||||
relative = dateutil.relativedelta.relativedelta(
|
||||
*sorted([later, now], reverse=True))
|
||||
|
||||
dts = [later, now]
|
||||
relative = dateutil.relativedelta.relativedelta(max(dts), min(dts))
|
||||
years = relative.years
|
||||
months = relative.months
|
||||
weeks, days = divmod(relative.days, 7)
|
||||
|
|
Loading…
Reference in a new issue