forked from AFPy/afpy.org
Fix timestamps again
This commit is contained in:
parent
baf34b753c
commit
532d95d415
7
afpy.py
7
afpy.py
|
@ -264,9 +264,10 @@ def feed(name):
|
|||
abort(404)
|
||||
entries = []
|
||||
for post in data.get_posts(name, data.STATE_PUBLISHED, end=50):
|
||||
timestamp = post[data.TIMESTAMP]
|
||||
post['timestamp'] = post[data.TIMESTAMP]
|
||||
post['link'] = url_for(
|
||||
'post', name=name, timestamp=timestamp, _external=True
|
||||
'post', name=name, timestamp=post['timestamp'],
|
||||
_external=True
|
||||
)
|
||||
entries.append({'content': post})
|
||||
title = f'{data.POSTS[name]} AFPy.org'
|
||||
|
@ -322,7 +323,7 @@ def status():
|
|||
|
||||
@app.template_filter('rfc822_datetime')
|
||||
def format_rfc822_datetime(timestamp):
|
||||
return email.utils.formatdate(timestamp)
|
||||
return email.utils.formatdate(int(timestamp))
|
||||
|
||||
|
||||
@app.template_filter('parse_iso_datetime')
|
||||
|
|
|
@ -9,9 +9,7 @@
|
|||
<title><![CDATA[ {% if entry.feed %}[{{ entry.feed | safe }}]{% endif %} {{ entry.content.title | safe }} ]]></title>
|
||||
<description><![CDATA[ {{ (entry.content.description or entry.content.summary) | safe }} ]]></description>
|
||||
<link>{{ entry.content.link }}</link>
|
||||
{% if entry.content.timestamp %}
|
||||
<pubDate>{{ entry.content.timestamp | rfc822_datetime }}</pubDate>
|
||||
{% endif %}
|
||||
<pubDate>{{ entry.content.timestamp | rfc822_datetime }}</pubDate>
|
||||
</item>
|
||||
{% endfor %}
|
||||
</channel>
|
||||
|
|
Loading…
Reference in New Issue
Block a user