Skip to content

Commit aa8493e

Browse files
[update] description of edit-event event
1 parent ae4a5db commit aa8493e

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

docs/api/events/js_eventcalendar_editevent_event.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ description: You can learn about the edit-event event in the documentation of th
1515
~~~jsx {}
1616
"edit-event": ({
1717
id?: string | number,
18-
add?: boolean
18+
add?: boolean | object
1919
}) => void;
2020
~~~
2121

@@ -24,7 +24,9 @@ description: You can learn about the edit-event event in the documentation of th
2424
The callback of the **edit-event** event can take an object with the following parameters:
2525

2626
- `id` - (optional) an ID of the event to be edited
27-
- `add` - (optional) enables/disables an ability to add new event
27+
- `add` - (optional) an ability to add new event. This parameter takes one of 2 available options:
28+
- **true** / **false** - enables/disables an ability to add new event
29+
- **object** - an object of new event
2830

2931
Depending on the passed parameters, you can perform the following operations:
3032

@@ -41,9 +43,21 @@ calendar.api.exec("edit-event", { id: "1" });
4143

4244
2) **open the editor** for the new event
4345

44-
~~~jsx {2}
46+
~~~jsx {2,5-14}
4547
// open the editor for the new event
4648
calendar.api.exec("edit-event", { add: true });
49+
50+
// open the editor for the new event with the initial data
51+
calendar.api.exec("edit-event", {
52+
add: {
53+
id: "44",
54+
type: "meeting",
55+
start_date: new Date("2023-09-16T15:00:00"),
56+
end_date: new Date("2023-09-16T16:00:00"),
57+
text: "Custom event",
58+
details: "Rome, Italy",
59+
}
60+
});
4761
~~~
4862

4963
3) **close the editor**

0 commit comments

Comments
 (0)