diff options
Diffstat (limited to 'searx/webutils.py')
| -rw-r--r-- | searx/webutils.py | 8 |
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() |