Tidy up 'last_checked' date handling

pull/1/head
Leigh Morresi 2021-01-29 14:45:12 +01:00
rodzic 04c8ea7960
commit abef169382
2 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -57,7 +57,7 @@ def _jinja2_filter_datetime(watch_obj, format="%Y-%m-%d %H:%M:%S"):
if watch_obj['last_checked'] == 0:
return 'Not yet'
return datetime.datetime.utcfromtimestamp(int(watch_obj['last_checked'])).strftime(format)
return timeago.format(int(watch_obj['last_checked']), time.time())
# @app.context_processor

Wyświetl plik

@ -8,14 +8,13 @@
<legend>Add new change detection watch</legend>
<input type="url" placeholder="https://..." name="url"/>
<input type="text" placeholder="tag" size="10" name="tag"/>
<button type="submit" class="pure-button pure-button-primary">Save</button>
<button type="submit" class="pure-button pure-button-primary">Watch</button>
</fieldset>
<!-- add extra stuff, like do a http POST and send headers -->
<!-- user/pass r = requests.get('https://api.github.com/user', auth=('user', 'pass')) -->
</form>
<!-- make a nice list of tags here to click on -->
<i>Note: Times are in UTC for now - todo - JS front end format<br/></i>
<div id="watch-table-wrapper">
<table class="pure-table pure-table-striped watch-table">
<thead>