template (filters): set locale when using "date_fmt"
This commit is contained in:
parent
e1ff10bf77
commit
bc061ee885
1 changed files with 4 additions and 5 deletions
|
|
@ -646,15 +646,14 @@ class Renderer(object):
|
|||
current = ctx["gidx"].current(value)
|
||||
return value if not current else u"{}_{}".format(value, current)
|
||||
|
||||
def _date_fmt(
|
||||
self, timestamp, fmt="short", date_only=False, auto_limit=None, auto_old_fmt=None
|
||||
):
|
||||
def _date_fmt(self, timestamp, fmt="short", date_only=False, auto_limit=None,
|
||||
auto_old_fmt=None):
|
||||
if is_undefined(fmt):
|
||||
fmt = u"short"
|
||||
|
||||
try:
|
||||
return date_utils.date_fmt(
|
||||
timestamp, fmt, date_only, auto_limit, auto_old_fmt
|
||||
timestamp, fmt, date_only, auto_limit, auto_old_fmt,
|
||||
locale_str = self._locale_str
|
||||
)
|
||||
except Exception as e:
|
||||
log.warning(_(u"Can't parse date: {msg}").format(msg=e))
|
||||
|
|
|
|||
Loading…
Reference in a new issue