aboutsummaryrefslogtreecommitdiff
path: root/src/web/views
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2016-01-29 21:08:31 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-01-29 21:08:31 +0100
commit6d681cba9d4da213d3de727570f17d2361f599de (patch)
treeee33d4f5cecd00688d8650f98da56d558700196f /src/web/views
parentimpact on menus when loading article (diff)
downloadnewspipe-6d681cba9d4da213d3de727570f17d2361f599de.tar.gz
newspipe-6d681cba9d4da213d3de727570f17d2361f599de.tar.bz2
newspipe-6d681cba9d4da213d3de727570f17d2361f599de.zip
displaying date on middle panel
Diffstat (limited to 'src/web/views')
-rw-r--r--src/web/views/views.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/web/views/views.py b/src/web/views/views.py
index 1ee3d06d..49554cb3 100644
--- a/src/web/views/views.py
+++ b/src/web/views/views.py
@@ -284,13 +284,18 @@ def _get_filters(in_dict):
return filters
+import calendar
+
+
def _articles_to_json(articles, fd_hash=None):
return jsonify(**{'articles': [{'title': art.title, 'liked': art.like,
'read': art.readed, 'article_id': art.id, 'selected': False,
'feed_id': art.feed_id, 'category_id': art.category_id or 0,
'feed_title': fd_hash[art.feed_id]['title'] if fd_hash else None,
'icon_url': fd_hash[art.feed_id]['icon_url'] if fd_hash else None,
- 'date': art.date} for art in articles.limit(1000)]})
+ 'date': art.date,
+ 'timestamp': calendar.timegm(art.date.timetuple()) * 1000}
+ for art in articles.limit(1000)]})
@app.route('/middle_panel')
bgstack15