Ir al contenido

co-event-calendar

Muestra los eventos del mes con una barra de herramientas (hoy / anterior / siguiente / cambio de vista) y delega el pintado en la vista activa (fase 1: month). Los eventos son CONTROLADOS: el componente emite solicitudes (coEventDrop, coDateSelect) y el host las aplica actualizando la propiedad events (dejarla igual ante un fallo es el revert). Los instantes son ISO-8601 con offset/Z (con hora) o YYYY-MM-DD (todo el día); time-zone controla el render en hora de pared. La propiedad events acepta un array o una cadena JSON.

Ver código
<co-event-calendar date="2026-07-15" locale="es-CO" time-zone="America/Bogota" events='[{"id":"1","title":"Demo cliente","start":"2026-07-15T16:00:00Z","end":"2026-07-15T17:00:00Z"},{"id":"2","title":"Viaje Bogotá","start":"2026-07-20","end":"2026-07-23","allDay":true}]'></co-event-calendar>

Props

PropAtributoTipoDefaultDescripción
availableViewsavailable-viewsstring | string[]['month']Views offered in the switcher. Defaults to the implemented set.
datedatestring | undefinedAnchor date "YYYY-MM-DD" controlling the visible period. Persisted by host.
dayMaxEventsday-max-eventsnumber3Max event lanes per day before "+N more".
defaultDurationMinutesdefault-duration-minutesnumber60Default minutes for a timed event missing an end.
editableeditablebooleantrueMaster interaction gate (per-event `editable` can still lock individuals).
eventseventsCoCalendarEvent[] | string[]Events: an array or a JSON string (raw-HTML use).
firstDayOfWeekfirst-day-of-weeknumber1First day of week, 0=Sun..6=Sat.
localelocalestring'es-CO'BCP-47 locale for labels.
maxDatemax-datestring | undefinedLatest interactable day "YYYY-MM-DD".
minDatemin-datestring | undefinedEarliest interactable day "YYYY-MM-DD" (past-block).
selectableselectablebooleantrueAllow empty-day selection to request a create.
statusColorsstatus-colorsstring | undefined | { backgroundColor?: string | undefined; borderColor?: string | undefined; }Optional status→{backgroundColor,borderColor} map (object or JSON string).
timeZonetime-zonestring | undefinedIANA timezone for wall-clock rendering. Defaults to the browser zone.
viewview"agenda" | "day" | "month" | "week"'month'Active view. Phase 1 ships `month`; week/day/agenda land in later phases.

Eventos

EventoDetailBubblesCancelableDescripción
coDateSelect{ start: string; end: string; allDay: boolean; }A date/range was selected (create request).
coDatesSet{ view: string; start: string; end: string; activeDate: string; }The visible period changed → host should refetch and persist the view pref.
coEventClick{ event: NormalizedEvent; }An event chip was activated.
coEventDrop{ event: NormalizedEvent; start: string; end: string; oldStart: string; oldEnd: string; allDay: boolean; revert: () => void; }An event was dragged to a new time (move). `revert` is a host convenience.
coMoreClick{ date: string; events: NormalizedEvent[]; }"+N more" was activated for a day.
coViewChange{ view: string; }The active view changed.

Slots

Este componente no expone slots.

CSS Parts

PartDescripción
::part(body)The active view container
::part(toolbar)The header toolbar

CSS Custom Properties

Este componente no expone CSS custom properties.