From f7d79364996a321e7e8e2766307798ec73b64a48 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Thu, 28 Jun 2018 13:03:53 +1000 Subject: [PATCH] Whoops, make sure ago actually emits the /correct/ relative timestamps using the right timezone --- lemoncurry/jinja2/ago.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lemoncurry/jinja2/ago.py b/lemoncurry/jinja2/ago.py index 0bc6914..9da1a1d 100644 --- a/lemoncurry/jinja2/ago.py +++ b/lemoncurry/jinja2/ago.py @@ -3,4 +3,7 @@ from datetime import datetime def ago(dt: datetime) -> str: + # We have to convert the datetime we get to local time first, because ago + # just strips the timezone from a timezone-aware datetime. + dt = dt.astimezone() return human(dt, past_tense='{}', abbreviate=True)