update-event
Updates an existing event in the store. For events expanded from a recurrence rule, rawId selects the whole series or one occurrence, and mode selects single-occurrence versus this-and-following behavior.
Usage
type UpdateEventPayload = {
id: EventID;
rawId?: EventID;
event: Partial<CalendarEvent>;
mode?: "single" | "following";
};
| Field | Type | Description |
|---|---|---|
id | string | number | Canonical stored event id; the update target. |
rawId | string | number | Rendered occurrence identifier. A canonical rawId with no occurrence suffix edits the master; a suffixed one (e.g. "7###2026-03-09") edits that occurrence. For an ordinary event, rawId === id. |
event | Partial<CalendarEvent> | Fields to update; merged into the stored event. |
mode | "single" | "following" | For occurrence-level recurring edits: "single" affects one occurrence, "following" this one and later ones. Omitting it defaults to "single" at the store. |
The occurrence date is decoded from rawId — there is no separate originalDate field on the public payload.
For recurring events the store branches on rawId:
- A canonical
rawIdedits the master, so every future expansion reflects the change. Adding anrruleto a one-off event here normalizes itsdurationand range envelope; clearing a master'srruleturns it back into a one-off and cascadesdelete-eventcalls to its exceptions. - A suffixed
rawIdedits one occurrence:mode: "single"writes an exception for that date,mode: "following"splits the series at it. After an occurrence update of the selected event, the action re-dispatchesselect-eventfor the resulting exception or new master (its canonical id as bothidandrawId), so later auto-saves edit that record directly.
See Recurring events for the full model.
Trigger
// Whole-series edit: canonical rawId
api.exec("update-event", {
id: 7,
event: { text: "Renamed" },
});
// Single occurrence: suffixed rawId plus mode
api.exec("update-event", {
id: 7,
rawId: "7###2026-03-09",
mode: "single",
event: { text: "Just this one" },
});
Observe
api.on("update-event", p => console.log("updated", p.id, p.event));
Intercept
api.intercept("update-event", p => p.event.text !== "");
Returning false cancels the update before it reaches the store.
Component handler
<Calendar
:events="[]"
:date="new Date()"
:onupdateevent="p => console.log(p.id, p.event, p.mode)"
/>
Related articles
add-event— counterpart that creates events.delete-event— remove instead of update.select-event— open the editor that auto-saves throughupdate-event.- Recurring events —
rawIdandmodesemantics for series and occurrence edits. - Persisting changes — forward updates to a backend.