diff options
| author | 2020-01-28 15:31:49 +0000 | |
|---|---|---|
| committer | 2020-01-28 15:31:49 +0000 | |
| commit | a4e827cbb5966f95609a96af3c0b521816afe9ee (patch) | |
| tree | 3a6d386e00e415534ad7e7fd083db3a24e52bf71 /modules | |
| parent | refuse to unload core modules (diff) | |
| signature | ||
switch tweets to use utils.datetime.to_pretty_time()
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/tweets/format.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/tweets/format.py b/modules/tweets/format.py index 3248dc36..8726ae2b 100644 --- a/modules/tweets/format.py +++ b/modules/tweets/format.py @@ -3,8 +3,8 @@ from src import utils def _timestamp(dt): seconds_since = time.time()-dt.timestamp() - since, unit = utils.datetime.time_unit(seconds_since) - return "%s %s ago" % (since, unit) + timestamp = utils.datetime.to_pretty_time(seconds_since, max_units=2) + return "%s ago" % timestamp def _normalise(tweet): return html.unescape(utils.parse.line_normalise(tweet)) |
