Fix Todoist incorrect end date when task has no time (#52258)

pull/52314/head
Koen Kanters 2021-06-29 19:15:50 +02:00 committed by GitHub
parent 6afa4d6914
commit 2576dd9da9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -230,7 +230,7 @@ def _parse_due_date(data: dict, gmt_string) -> datetime:
"""Parse the due date dict into a datetime object."""
# Add time information to date only strings.
if len(data["date"]) == 10:
data["date"] += "T00:00:00"
return datetime.fromisoformat(data["date"]).replace(tzinfo=dt.UTC)
if dt.parse_datetime(data["date"]).tzinfo is None:
data["date"] += gmt_string
return dt.as_utc(dt.parse_datetime(data["date"]))