aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2021-09-21 21:51:20 -0700
committerGravatar MarkKoz <[email protected]>2021-09-21 21:51:20 -0700
commitf6382a3eea81c1dd97b2e12fc81d42f8c77a4ae4 (patch)
treef07a5d6d5e60651768c7cd870b5f4de263b7afbd
parentTime: put region comments around overloads (diff)
Time: fix format_with_duration's 2nd arg's default
It wasn't passing the current time when `other_timestamp` was None.
-rw-r--r--bot/utils/time.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/utils/time.py b/bot/utils/time.py
index 005608beb..dfe65369e 100644
--- a/bot/utils/time.py
+++ b/bot/utils/time.py
@@ -299,6 +299,9 @@ def format_with_duration(
if timestamp is None:
return None
+ if other_timestamp is None:
+ other_timestamp = arrow.utcnow()
+
formatted_timestamp = discord_timestamp(timestamp)
duration = humanize_delta(timestamp, other_timestamp, max_units=max_units)