Skip to content

Commit

Permalink
[update] description of edit-event event
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiipylypchuk1991 committed Sep 14, 2023
1 parent ae4a5db commit aa8493e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions docs/api/events/js_eventcalendar_editevent_event.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ description: You can learn about the edit-event event in the documentation of th
~~~jsx {}
"edit-event": ({
id?: string | number,
add?: boolean
add?: boolean | object
}) => void;
~~~

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

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

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

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

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

~~~jsx {2}
~~~jsx {2,5-14}
// open the editor for the new event
calendar.api.exec("edit-event", { add: true });

// open the editor for the new event with the initial data
calendar.api.exec("edit-event", {
add: {
id: "44",
type: "meeting",
start_date: new Date("2023-09-16T15:00:00"),
end_date: new Date("2023-09-16T16:00:00"),
text: "Custom event",
details: "Rome, Italy",
}
});
~~~

3) **close the editor**
Expand Down

0 comments on commit aa8493e

Please sign in to comment.