From af053c5f341da58b97f4dbdde9736522a96288c9 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sat, 1 May 2021 18:36:13 +0200 Subject: [PATCH] tools (common/date_utils): fix `date_only` for `short`, `long` and `full` format --- sat/tools/common/date_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sat/tools/common/date_utils.py b/sat/tools/common/date_utils.py index 86efcbaa..bd728acb 100644 --- a/sat/tools/common/date_utils.py +++ b/sat/tools/common/date_utils.py @@ -150,9 +150,9 @@ def date_fmt(timestamp, fmt="short", date_only=False, auto_limit=7, auto_old_fmt 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,