Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jaesivsm committed Apr 17, 2016
1 parent 3265b41 commit 36736fb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/web/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ def get_menu():
for feed_id, feed in feeds.items():
created_date = localize(feed.created_date)
last_retrieved = localize(feed.last_retrieved)
feed['created_rel'] = gettext("%(timedelta)s ago",
timedelta=format_timedelta(now - created_date,
locale=locale))
feed['last_rel'] = gettext("%(timedelta)s ago",
timedelta=format_timedelta(now - last_retrieved, locale=locale))
feed['created_rel'] = format_timedelta(created_date - now,
add_direction=True, locale=locale)
feed['last_rel'] = format_timedelta(last_retrieved - now,
locale=locale, add_direction=True)
feed['created_date'] = format_datetime(created_date, locale=locale)
feed['last_retrieved'] = format_datetime(last_retrieved, locale=locale)
feed['category_id'] = feed.category_id or 0
Expand Down Expand Up @@ -115,10 +114,9 @@ def _articles_to_json(articles):
'feed_title': fd_hash[art.feed_id]['title'],
'icon_url': fd_hash[art.feed_id]['icon_url'],
'date': format_datetime(localize(art.date), locale=locale),
'rel_date': gettext("%(timedelta)s ago",
timedelta=format_timedelta(now - localize(art.date),
'rel_date': format_timedelta(localize(art.date) - now,
threshold=1.1, add_direction=True,
locale=locale))}
locale=locale)}
for art in articles.limit(1000)]}


Expand Down

0 comments on commit 36736fb

Please sign in to comment.