Workaround for #889

pull/906/head
Ozzieisaacs 6 years ago
parent 6a7b8c7870
commit f941908f73

@ -407,9 +407,14 @@ def mimetype_filter(val):
@app.template_filter('formatdate') @app.template_filter('formatdate')
def formatdate_filter(val): def formatdate_filter(val):
try:
conformed_timestamp = re.sub(r"[:]|([-](?!((\d{2}[:]\d{2})|(\d{4}))$))", '', val) conformed_timestamp = re.sub(r"[:]|([-](?!((\d{2}[:]\d{2})|(\d{4}))$))", '', val)
formatdate = datetime.datetime.strptime(conformed_timestamp[:15], "%Y%m%d %H%M%S") formatdate = datetime.datetime.strptime(conformed_timestamp[:15], "%Y%m%d %H%M%S")
return format_date(formatdate, format='medium', locale=get_locale()) return format_date(formatdate, format='medium', locale=get_locale())
except AttributeError as e:
app.logger.error('Babel error: %s, Current user locale: %s, Current User: %s' % (e, current_user.locale, current_user.nickname))
return formatdate
@app.template_filter('formatdateinput') @app.template_filter('formatdateinput')

Loading…
Cancel
Save