> For the complete documentation index, see [llms.txt](https://docs.videsk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.videsk.io/es-developers/sdks/calendario/eventos.md).

# Eventos

## `days`

Este evento se dispara cuando se ha llamado al método `getDays`. El evento contiene los mismos valores de retorno que el método `getDays`.

```javascript
calendar.addEventListener('days', event => {
    const days = event.detail;
});
```

## `hours`

Este evento se dispara cuando se ha llamado al método `getHours`. El evento contiene los mismos valores de retorno que el método `getHours`.

```javascript
calendar.addEventListener('hours', event => {
    const hours = event.detail;
});
```

## `created`

Este evento se dispara cuando se ha llamado al método `create`. El evento contiene los mismos valores de retorno que el método `create`.

```javascript
calendar.addEventListener('created', event => {
    const response = event.detail;
});
```

## `canceled`

Este evento se dispara cuando se ha llamado al método `cancel`. El evento contiene los mismos valores de retorno que el método `cancel`.

```javascript
calendar.addEventListener('canceled', event => {
    const response = event.detail;
});
```

## `rescheduled`

Este evento se dispara cuando se ha llamado al método `reschedule`. El evento contiene los mismos valores de retorno que el método `reschedule`.

```javascript
calendar.addEventListener('rescheduled', event => {
    const response = event.detail;
});
```

## `join`

Este evento se dispara cuando se ha llamado al método `join`. El evento contiene el `accessToken` necesario para comenzar la videollamada.

{% hint style="info" %}
Con este evento deberás hacer uso de nuestro SDK de [WebRTC](/es-developers/sdks/webrtc.md#uso).
{% endhint %}

{% hint style="danger" %}
Recuerda que deberás escuchar el evento [hangup](/es-developers/sdks/webrtc/metodos.md#addeventlistener) de WebRTC para terminar el llamado, usando el método [destroy](/es-developers/sdks/webrtc/metodos.md#destroy). De lo contrario, la llamada seguirá activa.
{% endhint %}

```javascript
calendar.addEventListener('join', event => {
    const { accessToken } = event.detail;
    const webrtc = new WebRTC();
    await webrtc.create(accessToken);
});
```

{% content-ref url="/pages/-MbZ7VU4FhQ3OhWHFrJ2" %}
[WebRTC](/es-developers/sdks/webrtc.md)
{% endcontent-ref %}

## `modify`

Este evento se dispara cuando se ha llamado al método `modify`. El evento contiene la acción a realizar `action` y el token de aceso `accessToken`.

{% hint style="warning" %}
Es importante mantener siempre disponible `v-schedule-action` y `v-schedule-auth` en la URL, o bien las mismas keys pero en `localStorage`. De lo contrario no podremos detactar y emitir este evento.
{% endhint %}

```javascript
calendar.addEventListener('modify', event => {
    const { action, accessToken } = event;
});
```

En base a la acción, deberás mostrar la opción de cancelar o reagendar. La key `action` puede ser:

* `join`: Indica que se desea unir a la reunión
* `modify`: Indica que se desea modificar la cita

{% hint style="info" %}
Aquí deberás hacer uso del método `cancel` y `reschedule`.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.videsk.io/es-developers/sdks/calendario/eventos.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
