Skip to content

Commit

Permalink
Fixed home-assistant#25814 by correcting TZ interpretation of all day…
Browse files Browse the repository at this point in the history
… of events
  • Loading branch information
franc6 committed Apr 1, 2021
1 parent 76d0f93 commit 0c4ae00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion homeassistant/components/caldav/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ def to_datetime(obj):
# represent same time regardless of which time zone is currently being observed
return obj.replace(tzinfo=dt.DEFAULT_TIME_ZONE)
return obj
return dt.as_local(dt.dt.datetime.combine(obj, dt.dt.time.min))
return dt.dt.datetime.combine(obj, dt.dt.time.min).replace(
tzinfo=dt.DEFAULT_TIME_ZONE
)

@staticmethod
def get_attr_value(obj, attribute):
Expand Down

0 comments on commit 0c4ae00

Please sign in to comment.