summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-05-10 10:35:07 +0200
committerAnton Khirnov <anton@khirnov.net>2021-05-10 10:35:07 +0200
commit4b5e28054c73dbfee3714ad16f2f7ae692fb175e (patch)
treea7b53b15e9bff930113410f32c7c7fc4c553f2fa
parent26588399f5ba0f3c3676136b047509440cbe93dc (diff)
settings/manager: handle future dates in _pretty_datetime()
-rw-r--r--alot/settings/manager.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/alot/settings/manager.py b/alot/settings/manager.py
index af8718e0..f8ade6df 100644
--- a/alot/settings/manager.py
+++ b/alot/settings/manager.py
@@ -63,7 +63,9 @@ def _pretty_datetime(d):
now = datetime.now()
today = now.date()
- if d.date() == today or d > now - timedelta(hours=6):
+ if d > now + timedelta(seconds = 59):
+ string = 'future'
+ elif d.date() == today or d > now - timedelta(hours=6):
delta = datetime.now() - d
if delta.seconds < 60:
string = 'just now'