Configuration
Views
The Event Calendar supports four view modes. On mobile screens (< 768px), the week view automatically switches to day view.
View Modes
| month | 6×7 grid showing the full month. Events appear as compact chips with "+N more" overflow. |
| week | 7-column layout with time slots. Includes an all-day section at the top and a time grid below. |
| day | Single-column detailed view of one day. Same layout as week view with one column. |
| agenda | Vertical list of days with event details. Configurable range via agendaDays. |
// Set initial view
calendar.viewMode = 'week';
// Switch views programmatically
calendar.viewMode = 'month';
// Navigate
calendar.today();
calendar.next();
calendar.previous();
calendar.goToDate(new Date('2027-03-15'));
// Listen for view changes
calendar.events.viewModeChanged$.subscribe(mode => {
console.log('Switched to', mode);
});First Day of Week
Configure which day starts the week in month and week views.
// Sunday = 0, Monday = 1, ..., Saturday = 6
calendar.settings.firstDayOfWeek = 1; // MondayWorking Hours
Define the working hours range displayed in week and day views. Non-working hours are visually distinguished.
calendar.settings.workingHours = { start: 8, end: 18 }; // 8 AM – 6 PMSlot Duration
Configure the time slot granularity in week and day views. Each slot corresponds to one row in the time grid.
Supported Values
| 5 | 5-minute slots (very fine-grained). |
| 10 | 10-minute slots. |
| 15 | 15-minute slots. |
| 20 | 20-minute slots. |
| 30 | 30-minute slots (default). |
| 60 | 1-hour slots. |
calendar.settings.slotDuration = 15; // 15-minute slotsWeek Numbers
Show ISO week numbers in the month and week views.
calendar.settings.showWeekNumbers = true;Agenda Days
Configure how many days the agenda view displays.
// Show 14 days in agenda view (default is 7)
calendar.settings.agendaDays = 14;Custom Rendering
Override the default entry rendering with a custom function. Return true to indicate you handled the rendering, or false to fall back to default.
calendar.entryRendering = ({ entry, element, isAllDay, viewMode, color }) => {
// Add a custom icon based on item type
const icon = entry.item.type === 'meeting' ? '📅' : '📌';
const label = document.createElement('span');
label.textContent = icon + ' ' + entry.title;
element.innerHTML = '';
element.appendChild(label);
return true; // handled
};
// Reset to default rendering
calendar.entryRendering = null;EntryRenderArgs
| entry: CalendarEntry | The entry (occurrence) being rendered. |
| element: HTMLElement | The DOM element to render into. |
| isAllDay: boolean | Whether this is rendered in the all-day section. |
| viewMode: ViewMode | Current view mode ('month' | 'week' | 'day' | 'agenda'). |
| color: EventCalendarEntryColor | Resolved color for the entry. |
Custom Tooltips
Customize the tooltip content shown when hovering over an entry. Return null to hide the tooltip.
calendar.entryTooltip = ({ entry, viewMode }) => {
return {
title: entry.title,
rows: [
{ label: 'Time', value: entry.startTime.toLocaleTimeString() + ' – ' + entry.endTime.toLocaleTimeString() },
{ label: 'Calendar', value: calendar.data.getCalendarById(entry.item.calendarId)?.name ?? '' },
{ label: 'Location', value: entry.location ?? '—' },
],
};
};
// Disable tooltips
calendar.entryTooltip = () => null;
// Reset to default
calendar.entryTooltip = null;