aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shirayuki Nekomata <[email protected]>2019-11-27 15:32:39 +0700
committerGravatar Shirayuki Nekomata <[email protected]>2019-11-27 15:32:39 +0700
commitf737fd4f6e0a351a95af856af7addf596f65ee5b (patch)
tree027a20b8a05e6770c8934c27d5f7369ee9faa0e3
parentAdded expiry duration when applying infraction ( including in the embed sent ... (diff)
Fixed "14 minutes, 60 seconds" by rounding `.total_seconds()` in `bot.utils.time.get_durations()`
-rw-r--r--bot/utils/time.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/bot/utils/time.py b/bot/utils/time.py
index 533b7ef83..873de21f0 100644
--- a/bot/utils/time.py
+++ b/bot/utils/time.py
@@ -137,6 +137,7 @@ def get_duration(date_from: datetime.datetime, date_to: datetime.datetime) -> st
:param date_to: A datetime.datetime object.
"""
div = abs(date_from - date_to).total_seconds()
+ div = round(div, 0) # to avoid (14 minutes, 60 seconds)
results: List[str] = []
for unit, name in TIME_MARKS:
div, amount = divmod(div, unit)