summaryrefslogtreecommitdiff
path: root/searx/webutils.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2022-09-23 19:58:14 +0200
committerAlexandre Flament <alex@al-f.net>2022-09-23 20:52:55 +0200
commitd6446be38f3f858c09887a89c8fc490a3c300b95 (patch)
tree1b911cba1b96970455b115d1cc706db52d5613da /searx/webutils.py
parent08b88597052dfdf17e947289d79510fdadad51e3 (diff)
[mod] science category: various update of about PR 1705
Diffstat (limited to 'searx/webutils.py')
-rw-r--r--searx/webutils.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/searx/webutils.py b/searx/webutils.py
index f084fe9d3..a5ed27c2c 100644
--- a/searx/webutils.py
+++ b/searx/webutils.py
@@ -141,7 +141,13 @@ def highlight_content(content, query):
return content
-def searxng_format_date(dt: datetime): # pylint: disable=invalid-name
+def searxng_l10n_timespan(dt: datetime) -> str: # pylint: disable=invalid-name
+ """Returns a human-readable and translated string indicating how long ago
+ a date was in the past / the time span of the date to the present.
+
+ On January 1st, midnight, the returned string only indicates how many years
+ ago the date was.
+ """
# TODO, check if timezone is calculated right # pylint: disable=fixme
d = dt.date()
t = dt.time()