Calendar
Full-sized drag & drop JavaScript event calendar with resource & timeline views
Install / Use
/learn @vkurko/CalendarREADME
EventCalendar

Full-sized drag & drop JavaScript event calendar with resource & timeline views:
- Lightweight (35kb br compressed)
- Minimal DOM structure (thanks to CSS Grid)
- Zero-dependency (standalone bundle)
- Used on over 70,000 websites with Bookly
Inspired by FullCalendar, it implements similar options.
Featured sponsors
<table> <tr> <td> </td> <td> </td> <td>:heavy_plus_sign: Get on the list
</td> </tr> </table>Table of contents
-
<table>
<tr><td>
- allDayContent
- allDaySlot
- buttonText
- columnWidth
- customButtons
- customScrollbars
- date
- dateClick
- dateIncrement
- datesAboveResources
- datesSet
- dayCellContent
- dayCellFormat
- dayHeaderAriaLabelFormat
- dayHeaderFormat
- dayMaxEvents
- dayPopoverFormat
- displayEventEnd
- dragConstraint
- dragScroll
- duration
- editable
- events
- eventAllUpdated
- eventBackgroundColor
- eventClassNames
- eventClick
- eventColor
- eventContent
- eventDidMount
- eventDragMinDistance
- eventDragStart
- eventDragStop
- eventDrop
- eventDurationEditable
- eventFilter
- eventLongPressDelay
- eventMouseEnter
- eventMouseLeave
- eventOrder
- eventResizableFromStart
- eventResize
- eventResizeStart
- eventResizeStop
- eventSources
- eventStartEditable
- eventTextColor
- eventTimeFormat
- filterEventsWithResources
- filterResourcesWithEvents
- firstDay
- flexibleSlotTimeLimits
- headerToolbar
- height
- hiddenDays
- highlightedDates
- icons
- lazyFetching
- listDayFormat
- listDaySideFormat
- loading
- locale
- longPressDelay
- monthHeaderFormat
- moreLinkContent
- noEventsClick
- noEventsContent
- nowIndicator
- pointer
- refetchResourcesOnNavigate
- resizeConstraint
- resourceExpand
- resources
- resourceLabelContent
- resourceLabelDidMount
- scrollTime
- select
- selectable
- selectBackgroundColor
- selectConstraint
- selectLongPressDelay
- selectMinDistance
- slotDuration
- slotEventOverlap
- slotHeight
- slotLabelFormat
- slotLabelInterval
- slotMaxTime
- slotMinTime
- slotWidth
- snapDuration
- theme
- titleFormat
- unselect
- unselectAuto
- unselectCancel
- validRange
- view
- viewDidMount
- views
- weekNumberContent
- weekNumbers
- <table> <tr><td> </td><td> </td><td> </td><td> </td></tr> </table>
Usage
JavaScript module
The first step is to install the EventCalendar core package:
npm install --save-dev @event-calendar/core
This package provides functions for creating and destroying the calendar, as well as plugins for various views. You must use at least one plugin that provides a view. The following plugins are currently available:
DayGridListResourceTimelineResourceTimeGridTimeGridInteraction(doesn't provide a view)
Then, in your JavaScript module:
import {createCalendar, destroyCalendar, TimeGrid} from '@event-calendar/core';
// Import CSS if your build tool supports it
import '@event-calendar/core/index.css';
let ec = createCalendar(
// HTML element the calendar will be mounted to
document.getElementById('ec'),
// Array of plugins
[TimeGrid],
// Options object
{
view: 'timeGridWeek',
events: [
// your list of events
]
}
);
// If you later need to destroy the calendar then use
destroyCalendar(ec);
Svelte 5 component
The first step is to install the EventCalendar core package:
npm install --save-dev @event-calendar/core
This package provides the Calendar component, as well as plugins for various views. You must use at least one plugin that provides a view. The following plugins are currently available:
DayGridListResourceTimelineResourceTimeGridTimeGridInteraction(doesn't provide a view)
Then in your Svelte 5 component, use the calendar like this:
<script>
import {Calendar, TimeGrid} from '@event-calendar/core';
let options = $state({
view: 'timeGridWeek',
events: [
// your list of events
]
});
</script>
<Calendar plugins={[TimeGrid]} {options} />
The calendar is destroyed gracefully when the component containing it is destroyed.
Standalone bundle
This bundle contains a version of the calendar that includes all plugins and is prepared for use in the browser via the <script> tag.
The first step is to include the following lines of code in the <head> section of your page:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.6.0/dist/event-calendar.min.css">
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.6.0/dist/event-calendar.min.js"></script>
<details>
<summary>Note</summary>
</details>Please note that the file paths contain an indication of a specific version of the library. You can remove this indication, then the latest version will be loaded:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build/dist/event-calendar.min.css"> <script src="https://cdn.jsdelivr.net/npm/@event-calendar/build/dist/event-calendar.min.js"></script>But it is recommended to always specify the version and explicitly update it if necessary, in order to avoid unpredictable problems when a new version of the library is released.
Then initialize the calendar like this:
let ec = EventCalendar.create(document.getElementById('ec'), {
view: 'timeGridWeek',
events: [
// your list of events
]
});
// If you later need to destroy the calendar then use
EventCalendar.destroy(ec);
Modifying options after initialization
You can modify the calendar options after initialization using the setOption method.
ec.setOption('slotDuration', '01:00');
In Svelte, you can simply update the original options object.
<script>
import {Calendar, TimeGrid
