Skip to content

Commit 1b8d71e

Browse files
authored
Update timezone requirements for calendar events (home-assistant#1601)
1 parent 2d2d29c commit 1b8d71e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/core/entity/calendar.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ A calendar entity can return events that occur during a particular time range. S
4848
- The `end_date` is the upper bound and applied to the event's `start` (exclusive).
4949
- Recurring events should be flattened and returned as individual `CalendarEvent`.
5050

51+
The start and end datetime will always have a timezone, which the implementation should be use for
52+
determing the order of events e.g. the start of an all day event for comparison with other events.
53+
5154
```python
5255
class MyCalendar(CalendarEntity):
5356

@@ -122,8 +125,8 @@ A `CalendarEvent` represents an individual event on a calendar.
122125

123126
| Name | Type | Default | Description |
124127
| ----------- | ---------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
125-
| start | datetime or date | **Required** | The start (inclusive) of the event. Must be before `end`. Both `start` and `end` must be the same type. As a datetime, must be in UTC timezone. |
126-
| end | datetime or date | **Required** | The end (exclusive) of the event. Must be after `start`. As a datetime, must be in UTC timezone. |
128+
| start | datetime or date | **Required** | The start (inclusive) of the event. Must be before `end`. Both `start` and `end` must be the same type. As a datetime, may have a timezone or be floating (which is interpreted as local timezone) |
129+
| end | datetime or date | **Required** | The end (exclusive) of the event. Must be after `start`. |
127130
| summary | string | **Required** | A title or summary of the event. |
128131
| location | string | `None` | A geographic location of the event. |
129132
| description | string | `None` | A detailed description of the event. |

0 commit comments

Comments
 (0)