New releasecore v2.3.0interface v1.5.0
Core Engine

@forcecalendar/core

Zero-dependency calendar logic for enterprise applications. Runs anywhere JavaScript runs: browser, Node, serverless, and edge.

View on GitHub
0
Dependencies
MIT
License
.d.ts
TypeScript
~35KB
Min + gzip

Calendar Engine

Complete control over calendar state, navigation, and rendering logic without DOM dependencies.

  • Month, week, and day view data, plus a list format for custom UIs
  • Navigation API with goToDate, next, previous
  • Event-driven state with subscribe/unsubscribe
Live Outputrunning
Loading...
calendar.tsTypeScript
import { Calendar } from '@forcecalendar/core';

const calendar = new Calendar({
  locale: 'en-US',
  timeZone: 'America/New_York',
  weekStartsOn: 0
});

calendar.setView('month');
calendar.goToDate(new Date('2026-03-16'));

calendar.on('viewChange', ({ view, date }) => {
  console.log('View:', view, date);
});

API surface

Every class exported from @forcecalendar/core.

Calendar

Core calendar engine with state, navigation, timezone conversion, and event management

Event

Event model with validation, normalization, and timezone-aware accessors

EventStore

Indexed event storage with range queries and conflict detection

StateManager

Reactive state management with subscribe/unsubscribe and history

DateUtils

Date math, formatting, and week/month grid helpers

EventSearch

Full-text search across event titles, descriptions, and fields

ICSParser

RFC 5545 iCalendar import and export

RecurrenceEngine

RRULE expansion with exceptions, overrides, and hard occurrence caps

EnhancedCalendar

Calendar extended with worker-backed search and RecurrenceEngineV2

ICSHandler

High-level ICS import/export API over ICSParser, including URL fetch

RecurrenceEngineV2

Extended recurrence engine with modified instances and complex DST handling

RRuleParser

Standalone RFC 5545 RRULE string parser

SearchWorkerManager

Offloads search indexing and queries to a Web Worker

InvertedIndex

Term-to-event index powering fast full-text lookups

TimezoneManager

IANA timezone conversions, DST detection, and offset math

ConflictDetector

Time, attendee, and resource overlap detection across event sets

Full API documentation at docs.forcecalendar.org/docs/api

1

Install

npm install @forcecalendar/core
2

Initialize

import { Calendar } from '@forcecalendar/core';

const calendar = new Calendar({
  locale: 'en-US',
  timeZone: 'America/New_York'
});
3

Add events

calendar.addEvent({
  title: 'Team Meeting',
  start: new Date('2026-03-16T10:00:00'),
  end: new Date('2026-03-16T11:00:00')
});