# HG changeset patch # User Goffi # Date 1555222911 -7200 # Node ID 8ca12f30f61ff8464e1e6f7bb67e92a24367028f # Parent 7dbdbd132649ee4450fb7db6b56200014c4dd08d template (filters): set locale when using "date_fmt" diff -r 7dbdbd132649 -r 8ca12f30f61f sat/tools/common/template.py --- a/sat/tools/common/template.py Sun Apr 14 08:21:51 2019 +0200 +++ b/sat/tools/common/template.py Sun Apr 14 08:21:51 2019 +0200 @@ -646,15 +646,14 @@ 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))