diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2014-12-08 23:48:01 +0100 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2014-12-08 23:48:01 +0100 |
| commit | 44409cb61f5677981feac10c344ea07fe20f718f (patch) | |
| tree | d739241a041a8ce9989debc1b619889e2d584d81 /searx/webapp.py | |
| parent | 70981f8055ae636e577fa675e2c7d62af7103c09 (diff) | |
| parent | 25c743f2afbf083d4ed715c7dc3f10d459b5205d (diff) | |
Merge pull request #141 from Cqoicebordel/UX+Bugs+HTML
UX+bugs+html
Diffstat (limited to 'searx/webapp.py')
| -rw-r--r-- | searx/webapp.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 57a16ff4f..9f09f51f5 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -294,10 +294,9 @@ def index(): # TODO, check if timezone is calculated right if 'publishedDate' in result: - if result['publishedDate'].replace(tzinfo=None)\ - >= datetime.now() - timedelta(days=1): - timedifference = datetime.now() - result['publishedDate']\ - .replace(tzinfo=None) + result['pubdate'] = result['publishedDate'].strftime('%Y-%m-%d %H:%M:%S%z') + if result['publishedDate'].replace(tzinfo=None) >= datetime.now() - timedelta(days=1): + timedifference = datetime.now() - result['publishedDate'].replace(tzinfo=None) minutes = int((timedifference.seconds / 60) % 60) hours = int(timedifference.seconds / 60 / 60) if hours == 0: @@ -305,8 +304,6 @@ def index(): else: result['publishedDate'] = gettext(u'{hours} hour(s), {minutes} minute(s) ago').format(hours=hours, minutes=minutes) # noqa else: - result['pubdate'] = result['publishedDate']\ - .strftime('%a, %d %b %Y %H:%M:%S %z') result['publishedDate'] = format_date(result['publishedDate']) if search.request_data.get('format') == 'json': |