adapted date format to Ymd such that its string representation is properly sortable

This commit is contained in:
Boockmann 2019-02-06 19:49:31 +01:00
commit 1f0294f4ac
2 changed files with 35 additions and 31 deletions

View File

@ -26,6 +26,7 @@ def main():
def production():
import config
print('PRODUKTION')
DB_HOST = os.environ.get('DB_HOST')
DB_NAME = os.environ.get('POSTGRES_DB')
DB_USER = os.environ.get('POSTGRES_USER')
@ -46,6 +47,7 @@ def production():
'lastchangeAt': note[5], 'permission': note[6], 'content': note[7]})
return render_template('index.html', notes=notes_arr, host=config.CODI_URL)
except Exception as e:
print(e)
return render_template('index.html')

View File

@ -23,7 +23,8 @@
</nav>
<div class="container">
<table id="example" class="table table-striped table-inverse table-bordered table-hover" cellspacing="0" width="100%">
<table id="example" class="table table-striped table-inverse table-bordered table-hover" cellspacing="0"
width="100%">
<thead>
<tr>
<th>id</th>
@ -40,7 +41,8 @@
<td scope="row"><a href="{{host}}/{{note['shortid']}}" target="_blank">{{note['shortid']}}</a></td>
<td>{{note['title']}}</td>
<td>{{note['alias']}}</td>
<td><span class="note-date">{{note['lastchangeAt'].strftime('%Y-%m-%d %H:%M')}}</span></td>
<td><span class="note-date">{% if note['lastchangeAt'] %}{{note['lastchangeAt'].strftime('%Y-%m-%d %H:%M')}}{% endif %}</span>
</td>
<td>{{note['permission']}}</td>
<td>{%if note['content']%}💬{%else%}❌{%endif%}</td>
</tr>