Tidy up 'last_checked' date handling

pull/1/head
Leigh Morresi 4 years ago
parent 04c8ea7960
commit abef169382

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

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

Loading…
Cancel
Save