You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(outlook): treat date-only bounds as all-day and guard partial all-day updates
Cursor round 2:
- Date-only bounds no longer produce a zero-length window. The param docs invited
a date like 2025-06-03 for an all-day event, but buildAllDayRange only ran when
isAllDay was explicitly true, so date-only input built a 00:00->00:00 timed
window that Graph rejects. A date-only bound carries no time, so the only
coherent reading is all-day; create/update now promote on that shape and the
descriptions state it.
- Converting an event to all-day with no bounds now fails with an actionable
message instead of a Graph 400. Graph requires all-day events to have midnight
start and end in the same zone, and those cannot be derived from a partial
PATCH against an event whose existing bounds are timed.
Copy file name to clipboardExpand all lines: apps/docs/content/docs/en/integrations/outlook.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -482,8 +482,8 @@ List Outlook calendar events within a start/end time window
482
482
| Parameter | Type | Required | Description |
483
483
| --------- | ---- | -------- | ----------- |
484
484
|`calendarId`| string | No | ID of the calendar to read. Defaults to the mailbox default calendar. |
485
-
|`startDateTime`| string |Yes| Start of the time window \(ISO 8601, e.g. 2025-06-03T00:00:00-08:00\). Interpreted as UTC if no offset is given. |
486
-
|`endDateTime`| string |Yes| End of the time window \(ISO 8601, e.g. 2025-06-10T00:00:00-08:00\). Interpreted as UTC if no offset is given. |
485
+
|`startDateTime`| string |No| Start of the time window \(ISO 8601, e.g. 2025-06-03T00:00:00-08:00\). Interpreted as UTC if no offset is given. Required unless paging with pageToken. |
486
+
|`endDateTime`| string |No| End of the time window \(ISO 8601, e.g. 2025-06-10T00:00:00-08:00\). Interpreted as UTC if no offset is given. Required unless paging with pageToken. |
487
487
|`maxResults`| number | No | Maximum number of events to return per page \(default: 10, max: 100\)|
488
488
|`orderBy`| string | No | Order of events \(default: start/dateTime\)|
489
489
|`pageToken`| string | No | Full @odata.nextLink URL from a previous page to continue paging |
@@ -567,8 +567,8 @@ Create a new Outlook calendar event
567
567
| --------- | ---- | -------- | ----------- |
568
568
|`calendarId`| string | No | ID of the calendar to create the event in. Defaults to the default calendar. |
569
569
|`subject`| string | Yes | Event subject/title |
570
-
|`startDateTime`| string | Yes | Start time \(ISO 8601, e.g. 2025-06-03T10:00:00-08:00\) or a date\(2025-06-03\) for an all-day event |
571
-
|`endDateTime`| string | Yes | End time \(ISO 8601, e.g. 2025-06-03T11:00:00-08:00\) or a date\(2025-06-04\) for an all-day event |
570
+
|`startDateTime`| string | Yes | Start time \(ISO 8601, e.g. 2025-06-03T10:00:00-08:00\). A date-only value \(2025-06-03\) for both start and end creates an all-day event.|
571
+
|`endDateTime`| string | Yes | End time \(ISO 8601, e.g. 2025-06-03T11:00:00-08:00\). A date-only value \(2025-06-04\) for both start and end creates an all-day event.|
572
572
|`timeZone`| string | No | IANA or Windows time zone name \(e.g. America/Los_Angeles\). Used for datetimes without a UTC offset. Defaults to UTC. |
573
573
|`body`| string | No | Event body content |
574
574
|`contentType`| string | No | Content type for the event body \(text or html\)|
@@ -616,14 +616,14 @@ Update an existing Outlook calendar event
616
616
| --------- | ---- | -------- | ----------- |
617
617
|`eventId`| string | Yes | The ID of the calendar event to update |
618
618
|`subject`| string | No | New event subject/title |
619
-
|`startDateTime`| string | No | New start time \(ISO 8601\) or a date\(2025-06-03\)for an all-day event|
620
-
|`endDateTime`| string | No | New end time \(ISO 8601\) or a date\(2025-06-04\)for an all-day event|
619
+
|`startDateTime`| string | No | New start time \(ISO 8601\). A date-only value \(2025-06-03\)converts the event to all-day.|
620
+
|`endDateTime`| string | No | New end time \(ISO 8601\). A date-only value \(2025-06-04\)converts the event to all-day.|
621
621
|`timeZone`| string | No | IANA or Windows time zone name applied to updated datetimes without a UTC offset. Defaults to UTC. |
622
622
|`body`| string | No | New event body content |
623
623
|`contentType`| string | No | Content type for the event body \(text or html\)|
624
624
|`location`| string | No | New event location display name |
625
625
|`attendees`| string | No | Replacement attendee email addresses \(comma-separated\)|
626
-
|`isAllDay`| boolean | No | Whether the event lasts the entire day |
626
+
|`isAllDay`| boolean | No | Whether the event lasts the entire day. Setting this true requires also sending startDateTime, since Graph needs midnight bounds.|
627
627
|`isOnlineMeeting`| boolean | No | Attach an online meeting to the event. Uses the mailbox default provider \(Teams on work/school accounts\); personal accounts have no supported online-meeting provider. |
// Converting to all-day needs midnight bounds with an exclusive end day. Graph
138
-
// rejects the whole PATCH if either bound is timed or the window is zero-length,
139
-
// so normalize both together — falling back to the supplied bound when the caller
140
-
// only gave one, which `buildAllDayRange` then advances to the next day.
147
+
if(settingAllDay){
148
+
// Graph requires an all-day event's start and end to both be midnight in the same
149
+
// zone, so flipping isAllDay on without bounds would 400 against whatever timed
150
+
// start/end the event already has. Fail with an actionable message instead.
151
+
if(providedBounds.length===0){
152
+
thrownewError(
153
+
'Converting an event to all-day requires startDateTime (and preferably endDateTime): Microsoft Graph requires all-day events to have midnight start and end bounds, which cannot be derived from a partial update.'
154
+
)
155
+
}
156
+
// Normalize both bounds together — falling back to the supplied one when only a
157
+
// single bound was given, which `buildAllDayRange` then advances to the next day.
0 commit comments