API Reference
EventStore API reference for the EventStore class.
import { EventStore } from '@forcecalendar/core' ;
new EventStore (options ?: { timezone?: string })
Method Signature Returns addEvent(data: EventData) => EventCreated Event updateEvent(id: string, updates: object) => EventUpdated Event removeEvent(id: string) => void— getEvent(id: string) => Event | undefinedEvent getAllEvents() => Event[]All events clear() => void— loadEvents(events: EventData[]) => void—
Method Signature Returns queryEvents(filters: QueryFilters) => Event[]Filtered events getEventsForDate(date: Date, tz?: string) => Event[]Events on date getEventsInRange(start: Date, end: Date, expand?: boolean, tz?: string) => Event[]Events in range getOverlappingEvents(start: Date, end: Date, excludeId = null) => Event[]Overlapping events
Field Type startDateendDatedateDatemonthnumberyearnumberallDaybooleanrecurringbooleanstatusstringcategoriesstring[]hasAttendeesbooleanorganizerEmailstringsort'start' | 'end' | 'title'
Method Signature Returns hasConflicts(start: Date, end: Date, excludeId = null) => boolean— checkConflicts(event: Event, options?: object) => objectConflict details getAllConflicts(start: Date, end: Date, options?: object) => Array<[Event, Event]>All conflict pairs getOverlapGroups(date: Date, timedOnly = true) => Event[][]Overlap groups calculateEventPositions(events: Event[]) => MapPositions getBusyPeriods(attendeeEmails: string[], start: Date, end: Date, options?: object) => Array<{start, end}>Busy periods getFreePeriods(start: Date, end: Date, durationMinutes: number, options?: object) => Array<{start, end}>Free periods addEventWithConflictCheck(event: EventData, allowConflicts = true) => EventCreated Event findEventsWithConflicts() => Event[]Conflicting events
Method Signature Returns startBatch(enableRollback?: boolean) => void— commitBatch() => void— rollbackBatch() => void— executeBatch(fn: Function, enableRollback?: boolean) => void— addEvents(events: EventData[]) => Event[]Created events updateEvents(updates: Array<{id, ...}>) => Event[]Updated events removeEvents(ids: string[]) => void—
Method Signature Returns expandRecurringEvent(event: Event, start: Date, end: Date) => Event[]Occurrences
Method Signature Returns subscribe(callback: Function) => FunctionUnsubscribe function
Method Signature Returns destroy() => void—
Method Purpose reconcile(events, options?)Diff a complete snapshot; return added/updated/removed/unchanged resolveEventId(id)Resolve an occurrence identity to its master getOccurrence(id, timezone?)Read the specific occurrence iterateOccurrences(eventId, options?)Lazy single-use occurrence generator getNextOccurrence(eventId, after?, options?)Next occurrence or null takeOccurrences(eventId, count, options?)Bounded next occurrences
Reconcile options include removeMissing and isEquivalent. Lazy options include exclusive after/before bounds, inclusive and timezone. See the store guide .
forceCalendar by N. R. Dhanawada