summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-05-25 22:41:04 +0200
committermathieui <mathieui@mathieui.net>2020-05-25 22:41:04 +0200
commit8462711fc6a3d86b9c67edd89a20b5fdedc02240 (patch)
treef5eb4a4ea8ebbdb8c8dc7e780529b5f5074ce868
parentec6c1bf81a2f2c96fedae310379255759a507c33 (diff)
downloadpoezio-8462711fc6a3d86b9c67edd89a20b5fdedc02240.tar.gz
poezio-8462711fc6a3d86b9c67edd89a20b5fdedc02240.tar.bz2
poezio-8462711fc6a3d86b9c67edd89a20b5fdedc02240.tar.xz
poezio-8462711fc6a3d86b9c67edd89a20b5fdedc02240.zip
Do not add the date in history messages from the current day
-rw-r--r--poezio/ui/render.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/poezio/ui/render.py b/poezio/ui/render.py
index c85d3cc5..633ac2a0 100644
--- a/poezio/ui/render.py
+++ b/poezio/ui/render.py
@@ -1,6 +1,9 @@
import curses
-from datetime import datetime
+from datetime import (
+ datetime,
+ date,
+)
from functools import singledispatch
from math import ceil, log10
from typing import (
@@ -235,7 +238,7 @@ class PreMessageHelpers:
Write the date on the yth line of the window
"""
if time:
- if history:
+ if history and time.date() != date.today():
format = LONG_FORMAT
else:
format = SHORT_FORMAT