tools (common/date_utils): fix date_only for short, long and full format
This commit is contained in:
parent
3ea9c6fdd9
commit
af053c5f34
1 changed files with 2 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue