Fix datatime parsing bug in api_client
This commit is contained in:
parent
cfc0ff1a0d
commit
cbc4a6d467
@ -585,6 +585,8 @@ class ApiClient(object):
|
||||
:param string: str.
|
||||
:return: date.
|
||||
"""
|
||||
if not string:
|
||||
return None
|
||||
try:
|
||||
from dateutil.parser import parse
|
||||
return parse(string).date()
|
||||
@ -606,6 +608,8 @@ class ApiClient(object):
|
||||
:param string: str.
|
||||
:return: datetime.
|
||||
"""
|
||||
if not string:
|
||||
return None
|
||||
try:
|
||||
from dateutil.parser import parse
|
||||
return parse(string)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user