Skip to content

Commit

Permalink
Fix all-day events entered in Google Cal - Reduce duplication with Gt…
Browse files Browse the repository at this point in the history
…asks
  • Loading branch information
bergercookie committed Aug 15, 2024
1 parent a764daf commit edfbaf6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions syncall/google/gcal_side.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,11 @@ def parse_datetime(cls, dt: GoogleDateT) -> datetime.datetime:
return cls.parse_datetime(dt_dt)

if isinstance(dt, dict):
date_time = dt.get("dateTime")
if date_time is None:
for key in "dateTime", "date":
if key in dt:
date_time = cast(str, dt.get(key))
break
else:
raise RuntimeError(f"Invalid structure dict: {dt}")

return cls.parse_datetime(date_time)
Expand Down

0 comments on commit edfbaf6

Please sign in to comment.