summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorThomas Pointhuber <thomas.pointhuber@gmx.at>2014-03-15 19:41:54 +0100
committerThomas Pointhuber <thomas.pointhuber@gmx.at>2014-03-15 19:41:54 +0100
commitd54ef01898a1bd289560ae757593df9f43fba7bc (patch)
treecb75d78f0690411e5c8ea184eeef0b135e5e30c8 /searx
parentef2b1b7515fbc029d566ab1afb80429007983fbb (diff)
downloadsearxng-d54ef01898a1bd289560ae757593df9f43fba7bc.tar.gz
searxng-d54ef01898a1bd289560ae757593df9f43fba7bc.zip
simplify publish Date formating
Diffstat (limited to 'searx')
-rw-r--r--searx/webapp.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 54061a462..251d5672b 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -164,21 +164,9 @@ def index():
minutes = int((timedifference.seconds/60)%60)
hours = int(timedifference.seconds/60/60)
if hours == 0:
- if minutes == 1:
- result['publishedDate'] = gettext(u'1 minute ago')
- else:
- result['publishedDate'] = gettext(u'{minutes} minutes ago').format(minutes=minutes)
+ result['publishedDate'] = gettext(u'{minutes} minute(s) ago').format(minutes=minutes)
else:
- if hours == 1:
- if minutes == 1:
- result['publishedDate'] = gettext(u'1 hour, 1 minute ago')
- else:
- result['publishedDate'] = gettext(u'1 hour, {minutes} minutes ago').format(minutes=minutes)
- else:
- if minutes == 1:
- result['publishedDate'] = gettext(u'{hours} hours, 1 minutes ago').format(hours=hours)
- else:
- result['publishedDate'] = gettext(u'{hours} hours, {minutes} minutes ago').format(hours=hours, minutes=minutes)
+ result['publishedDate'] = gettext(u'{hours} hour(s), {minutes} minute(s) ago').format(hours=hours, minutes=minutes)
else:
result['publishedDate'] = format_date(result['publishedDate'])