Use proper datetime formatting

This commit is contained in:
rubenwardy 2018-05-27 23:45:12 +01:00
parent dff967d3df
commit 48573fe922
No known key found for this signature in database
GPG Key ID: A1E29D52FF81513C
2 changed files with 11 additions and 1 deletions

@ -67,6 +67,7 @@
<td>Name</td>
<td>{{ package.name }}</td>
</tr>
{% if package.provides %}
<tr>
<td>Provides</td>
<td>{% for meta in package.provides %}
@ -76,6 +77,7 @@
{% endif %}
{% endfor %}</td>
</tr>
{% endif %}
<tr>
<td>Author</td>
<td class="{{ package.author.rank }}">
@ -92,6 +94,10 @@
<td>License</td>
<td>{{ package.license.name }}</td>
</tr>
<tr>
<td>Added</td>
<td>{{ package.created_at | datetime }}</td>
</tr>
</table>
<ul class="buttonset linedbuttonset">
@ -130,7 +136,7 @@
{% if not rel.approved %}<i>{% endif %}
<a href="{{ rel.url }}">{{ rel.title }}</a>,
created {{ rel.releaseDate }}.
created {{ rel.releaseDate | datetime }}.
{% if rel.task_id %}
<a href="{{ url_for('check_task', id=rel.task_id, r=package.getDetailsURL()) }}">Importing...</a>
{% elif not rel.approved %}

@ -35,6 +35,10 @@ def throw(err):
def domain(url):
return urlparse(url).netloc
@app.template_filter()
def datetime(value):
return value.strftime("%Y-%m-%d %H:%M") + " UTC"
@app.route("/uploads/<path:path>")
def send_upload(path):
return send_from_directory("public/uploads", path)