Browse Source

Fix display of zero timestamps

master
JustAnotherArchivist 3 years ago
parent
commit
ff096bf8dd
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      archivebot-jobs

+ 2
- 0
archivebot-jobs View File

@@ -212,6 +212,8 @@ def render_date(ts, coloured = False):
diff = currentTime - ts
colourStr = f"\x1b[{0 if diff < 6 * 3600 else 7};31m" if coloured and diff >= 300 else ""
colourEndStr = "\x1b[0m" if colourStr else ""
if ts == 0:
return 'N/A'
if args.dates:
return (colourStr, datetime.datetime.fromtimestamp(ts).isoformat(sep = " "), colourEndStr)
if diff < -86400:


Loading…
Cancel
Save