Skip to content

Commit 785db2f

Browse files
🩹 fix(.bin/human.py): Format future datetimes with in.
Instead of `... from now`.
1 parent 5160a8f commit 785db2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.bin/human.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ def datetime(x: dt.datetime, relative_to: Optional[dt.datetime]=None):
6464
delta = x - relative_to
6565
s = delta.total_seconds()
6666

67-
suffix = '' if s == 0 else ' ago' if s < 0 else ' from now'
68-
return seconds(abs(s)) + suffix
67+
fmt = '{}' if s == 0 else '{} ago' if s < 0 else 'in {}'
68+
return fmt.format(seconds(abs(s)))

0 commit comments

Comments
 (0)