1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-24 18:47:23 +00:00

Bugfix parsing publishing date with milliseconds (#114)

This commit is contained in:
OzzieIsaacs 2017-02-17 18:22:08 +01:00
parent ed459ddb9b
commit ad40a2b5a6

View File

@ -283,7 +283,7 @@ def mimetype_filter(val):
@app.template_filter('formatdate')
def formatdate(val):
conformed_timestamp = re.sub(r"[:]|([-](?!((\d{2}[:]\d{2})|(\d{4}))$))", '', val)
formatdate = datetime.datetime.strptime(conformed_timestamp[:-5], "%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())