Whoops, make sure ago actually emits the /correct/ relative timestamps using the right timezone

This commit is contained in:
Danielle McLean 2018-06-28 13:03:53 +10:00
parent c8faa30724
commit f7d7936499
Signed by: 00dani
GPG Key ID: 8EB789DDF3ABD240
1 changed files with 3 additions and 0 deletions

View File

@ -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)