Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion homeassistant/components/calendar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,9 @@ async def async_list_events_service(
end = start + service_call.data[EVENT_DURATION]
else:
end = service_call.data[EVENT_END_DATETIME]
calendar_event_list = await calendar.async_get_events(calendar.hass, start, end)
calendar_event_list = await calendar.async_get_events(
calendar.hass, dt_util.as_local(start), dt_util.as_local(end)
Comment thread
MartinHjelmare marked this conversation as resolved.
)
return {
"events": [
dataclasses.asdict(event, dict_factory=_list_events_dict_factory)
Expand Down
8 changes: 0 additions & 8 deletions homeassistant/components/demo/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ async def async_get_events(
end_date: datetime.datetime,
) -> list[CalendarEvent]:
"""Return calendar events within a datetime range."""
if start_date.tzinfo is None:
start_date = start_date.replace(
tzinfo=dt_util.get_time_zone(hass.config.time_zone)
)
if end_date.tzinfo is None:
end_date = end_date.replace(
tzinfo=dt_util.get_time_zone(hass.config.time_zone)
)
assert start_date < end_date
if self._event.start_datetime_local >= end_date:
return []
Expand Down