fix: Handle invalid date parsing
This commit is contained in:
parent
ba6415a88b
commit
ad95fbf519
1 changed files with 2 additions and 2 deletions
|
|
@ -54,8 +54,8 @@ def get_datetime(datetime_str=None):
|
|||
elif isinstance(datetime_str, datetime.date):
|
||||
return datetime.datetime.combine(datetime_str, datetime.time())
|
||||
|
||||
# dateutil parser does not agree with dates like 0001-01-01
|
||||
if not datetime_str or (datetime_str or "").startswith("0001-01-01"):
|
||||
# dateutil parser does not agree with dates like "0001-01-01" or "0000-00-00"
|
||||
if not datetime_str or (datetime_str or "").startswith(("0001-01-01", "0000-00-00")):
|
||||
return None
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue