TimelineKit

Configuration

Views

The Event Calendar supports four view modes. On mobile screens (< 768px), the week view automatically switches to day view.

View Modes

month6×7 grid showing the full month. Events appear as compact chips with "+N more" overflow.
week7-column layout with time slots. Includes an all-day section at the top and a time grid below.
daySingle-column detailed view of one day. Same layout as week view with one column.
agendaVertical 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; // Monday

Working 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 PM

Slot Duration

Configure the time slot granularity in week and day views. Each slot corresponds to one row in the time grid.

Supported Values

55-minute slots (very fine-grained).
1010-minute slots.
1515-minute slots.
2020-minute slots.
3030-minute slots (default).
601-hour slots.
calendar.settings.slotDuration = 15; // 15-minute slots

Week 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: CalendarEntryThe entry (occurrence) being rendered.
element: HTMLElementThe DOM element to render into.
isAllDay: booleanWhether this is rendered in the all-day section.
viewMode: ViewModeCurrent view mode ('month' | 'week' | 'day' | 'agenda').
color: EventCalendarEntryColorResolved 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;