@@ -88,7 +88,7 @@ def _date_and_delta(
8888
8989
9090def naturaldelta (
91- value : dt .timedelta | int ,
91+ value : dt .timedelta | float ,
9292 months : bool = True ,
9393 minimum_unit : str = "seconds" ,
9494) -> str :
@@ -97,7 +97,7 @@ def naturaldelta(
9797 This is similar to `naturaltime`, but does not add tense to the result.
9898
9999 Args:
100- value (datetime.timedelta or int ): A timedelta or a number of seconds.
100+ value (datetime.timedelta, int or float ): A timedelta or a number of seconds.
101101 months (bool): If `True`, then a number of months (based on 30.5 days) will be
102102 used for fuzziness between years.
103103 minimum_unit (str): The lowest unit that can be used.
@@ -206,7 +206,7 @@ def naturaldelta(
206206
207207
208208def naturaltime (
209- value : dt .datetime | int ,
209+ value : dt .datetime | float ,
210210 future : bool = False ,
211211 months : bool = True ,
212212 minimum_unit : str = "seconds" ,
@@ -217,7 +217,7 @@ def naturaltime(
217217 This is more or less compatible with Django's `naturaltime` filter.
218218
219219 Args:
220- value (datetime.datetime, int): A `datetime` or a number of seconds.
220+ value (datetime.datetime, int or float ): A `datetime` or a number of seconds.
221221 future (bool): Ignored for `datetime`s, where the tense is always figured out
222222 based on the current time. For integers, the return value will be past tense
223223 by default, unless future is `True`.
0 commit comments