forked from zaclys/searxng
simplify publish Date formating
This commit is contained in:
parent
ef2b1b7515
commit
d54ef01898
|
@ -164,21 +164,9 @@ def index():
|
||||||
minutes = int((timedifference.seconds/60)%60)
|
minutes = int((timedifference.seconds/60)%60)
|
||||||
hours = int(timedifference.seconds/60/60)
|
hours = int(timedifference.seconds/60/60)
|
||||||
if hours == 0:
|
if hours == 0:
|
||||||
if minutes == 1:
|
result['publishedDate'] = gettext(u'{minutes} minute(s) ago').format(minutes=minutes)
|
||||||
result['publishedDate'] = gettext(u'1 minute ago')
|
|
||||||
else:
|
else:
|
||||||
result['publishedDate'] = gettext(u'{minutes} minutes ago').format(minutes=minutes)
|
result['publishedDate'] = gettext(u'{hours} hour(s), {minutes} minute(s) ago').format(hours=hours, 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)
|
|
||||||
else:
|
else:
|
||||||
result['publishedDate'] = format_date(result['publishedDate'])
|
result['publishedDate'] = format_date(result['publishedDate'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue