This commit is contained in:
parent
7dc4babb5a
commit
ecdb4cc06e
@ -15,15 +15,17 @@ def link_exist_in_db(href):
|
||||
|
||||
def parse_date(str_to_parse, date_format=''):
|
||||
if str_to_parse is None:
|
||||
return datetime.fromtimestamp(0)
|
||||
date_to_format = datetime.fromtimestamp(0)
|
||||
elif isinstance(str_to_parse, datetime):
|
||||
return str_to_parse
|
||||
date_to_format = str_to_parse
|
||||
else:
|
||||
date = parse(str_to_parse, date_formats=[date_format])
|
||||
if date:
|
||||
return date.isoformat(' ', 'minutes')
|
||||
date_to_format = date
|
||||
else:
|
||||
return datetime.fromtimestamp(0).isoformat(' ', 'minutes')
|
||||
date_to_format = datetime.fromtimestamp(0)
|
||||
|
||||
return date_to_format.isoformat(' ', 'minutes')
|
||||
|
||||
|
||||
def boldify(str_to_replace, keyword):
|
||||
|
Reference in New Issue
Block a user