docs: is_invalid_data_string

This commit is contained in:
Hussain Nagaria 2023-12-16 22:21:44 +05:30
parent 1a2d8fe78a
commit d16683a699

View file

@ -71,6 +71,7 @@ def get_start_of_week_index() -> int:
def is_invalid_date_string(date_string: str) -> bool:
"""Returns True if the date string is invalid or None or empty."""
# dateutil parser does not agree with dates like "0001-01-01" or "0000-00-00"
return not isinstance(date_string, str) or (
(not date_string) or (date_string or "").startswith(("0001-01-01", "0000-00-00"))