forceCalendar
API Reference

Event

API reference for the Event class.

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

Constructor

new Event(data: EventData)

See Event Model for the full list of constructor properties.

Static Methods

MethodSignatureReturns
normalize(data: object) => EventDataNormalized event data
validate(data: object) => { valid: boolean, errors: string[] }Validation result
fromObject(obj: object) => EventEvent instance

Getters

GetterTypeDescription
durationnumberDuration in milliseconds
durationMinutesnumberDuration in minutes
durationHoursnumberDuration in hours (decimal)
isMultiDaybooleanSpans midnight
isCancelledbooleanStatus is cancelled
isTentativebooleanStatus is tentative
isConfirmedbooleanStatus is confirmed
isPrivatebooleanVisibility is private
isPublicbooleanVisibility is public
hasAttendeesbooleanHas attendees
hasRemindersbooleanHas reminders
isMeetingbooleanHas attendees
isVirtualbooleanHas conference data
categorystring | nullPrimary category

Instance Methods

MethodSignatureReturns
isRecurring() => booleanHas recurrence rule
occursOn(date: Date) => booleanOccurs on date
overlaps(other: Event) => booleanTime overlap
contains(datetime: Date) => booleanContains datetime
clone(updates?: object) => EventCloned event
toObject() => objectPlain object
equals(other: Event) => booleanDeep equality

Timezone Methods

MethodSignatureReturns
getStartInTimezone(tz: string) => DateStart in timezone
getEndInTimezone(tz: string) => DateEnd in timezone
updateTimes(start: Date, end: Date, tz?: string) => void

Attendee Methods

MethodSignatureReturns
addAttendee(attendee: object) => void
removeAttendee(email: string) => void
updateAttendeeResponse(email: string, status: string) => void
getAttendee(email: string) => object | undefinedAttendee
hasAttendee(email: string) => boolean
getAttendeesByStatus(status: string) => object[]Attendees
getAttendeeCounts() => object{ total, accepted, declined, ... }

Reminder Methods

MethodSignatureReturns
addReminder(reminder: object) => void
removeReminder(index: number) => void
getActiveReminders() => object[]Active reminders
getReminderTriggerTimes() => Date[]Trigger dates

Category Methods

MethodSignatureReturns
addCategory(category: string) => void
removeCategory(category: string) => void
hasCategory(category: string) => boolean
hasAnyCategory(categories: string[]) => boolean
hasAllCategories(categories: string[]) => boolean