Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
tamarinvs19 authored and tobixen committed Jul 31, 2023
1 parent e82731f commit 1f8b682
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions caldav/elements/cdav.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ def _to_utc_date_string(ts):
mindate = datetime.min.replace(tzinfo=utc_tz)
maxdate = datetime.max.replace(tzinfo=utc_tz)
if mindate + ts.tzinfo.utcoffset(ts) > ts:
logging.error("Cannot coerce datetime %s to UTC. Changed to min-date.", ts)
logging.error(
"Cannot coerce datetime %s to UTC. Changed to min-date.", ts
)
ts = mindate
elif ts > maxdate - ts.tzinfo.utcoffset(ts):
logging.error("Cannot coerce datetime %s to UTC. Changed to max-date.", ts)
logging.error(
"Cannot coerce datetime %s to UTC. Changed to max-date.", ts
)
ts = maxdate
else:
ts = ts.astimezone(utc_tz)
Expand Down

0 comments on commit 1f8b682

Please sign in to comment.