summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-05-25 22:47:06 +0200
committermathieui <mathieui@mathieui.net>2020-05-25 22:47:06 +0200
commit6943506fd3364bdd15c83b2d6543aea28ea98142 (patch)
treef5eb4a4ea8ebbdb8c8dc7e780529b5f5074ce868
parentec6c1bf81a2f2c96fedae310379255759a507c33 (diff)
parent8462711fc6a3d86b9c67edd89a20b5fdedc02240 (diff)
downloadpoezio-6943506fd3364bdd15c83b2d6543aea28ea98142.tar.gz
poezio-6943506fd3364bdd15c83b2d6543aea28ea98142.tar.bz2
poezio-6943506fd3364bdd15c83b2d6543aea28ea98142.tar.xz
poezio-6943506fd3364bdd15c83b2d6543aea28ea98142.zip
Merge branch 'display-today-history-without-date' into 'master'
Do not add the date in history messages from the current day See merge request poezio/poezio!126
-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