Mercurial > libervia-backend
changeset 3518:b258dce27d6d
tools (common/date_utils): fix `date_only` for `short`, `long` and `full` format
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 01 May 2021 18:36:13 +0200 (2021-05-01) |
parents | 8508fab9bcc2 |
children | 02eec2a5b5f9 |
files | sat/tools/common/date_utils.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/sat/tools/common/date_utils.py Sat May 01 18:30:01 2021 +0200 +++ b/sat/tools/common/date_utils.py Sat May 01 18:36:13 2021 +0200 @@ -150,9 +150,9 @@ return dates.format_timedelta( delta, granularity="minute", add_direction=True, locale=locale_str ) - elif fmt in ("short", "long"): + elif fmt in ("short", "long", "full"): if date_only: - dt = datetime.fromtimestamp(timestamp, tz_info) + dt = datetime.datetime.fromtimestamp(timestamp, tz_info) return dates.format_date(dt, format=fmt, locale=locale_str) else: return dates.format_datetime(timestamp, format=fmt, locale=locale_str,