Data
Resources
Resources represent the entities being scheduled — people, rooms, equipment, or vehicles. Each resource is displayed as a row.
Resource Types
| person | A person / team member. |
| room | A meeting room or space. |
| equipment | Equipment / hardware. |
| vehicle | A vehicle. |
Resource Properties
| id: string | Unique identifier (read-only). |
| name: string | Display name of the resource. |
| type: string | null | 'person' | 'room' | 'equipment' | 'vehicle' (or custom). |
| color: ColorValue | null | Color index or custom ColorDefinition. When set, all events for this resource use this color. |
| avatarUrl: string | null | URL to an avatar image (displayed in the sheet row). |
| filtered: boolean | Whether the resource is excluded by the active filter (read-only). |
Adding & Removing Resources
// Add a resource
const resource = SchedulerResource.fromAny({
id: 'r10', name: 'Eve Parker', type: 'person'
});
scheduler.data.addResource(resource);
// Insert at position
scheduler.data.insertResource(0, resource);
// Access resources
const first = scheduler.data.getResource(0);
const byId = scheduler.data.getResourceById('r10');
console.log(scheduler.data.resourcesLength);
// Reorder
scheduler.data.moveResource(resource, 2);
// Remove
scheduler.data.removeResource(resource);
scheduler.data.removeResources([resource1, resource2]);Events
Events are time blocks assigned to a resource. Each event has a start time, end time, and belongs to exactly one resource.
Event Properties
| id: string | Unique identifier (read-only). |
| resourceId: string | ID of the resource this event belongs to. |
| name: string | Display name of the event. |
| startTime: Date | Start date/time. |
| endTime: Date | End date/time. |
| color: ColorValue | null | Color override (overrides resource color). Can be a theme index or custom ColorDefinition. |
| data: any | Arbitrary user data attached to the event. Not serialized — lost during save()/load(). |
| durationMs: number | Duration in milliseconds (read-only). |
| durationHours: number | Duration in hours (read-only). |
Adding & Removing Events
// Create and add an event
const event = SchedulerEvent.fromAny({
id: 'e30',
resourceId: 'r1',
name: 'Code Review',
startTime: '2027-01-15T10:00:00',
endTime: '2027-01-15T12:00:00',
});
scheduler.data.addEvent(event);
// Access events
const byId = scheduler.data.getEventById('e30');
const forResource = scheduler.data.getEventsForResource('r1');
console.log(scheduler.data.eventsLength);
// Move event to a different resource
event.resourceId = 'r2';
// Change time
event.startTime = new Date('2027-01-16T09:00:00');
event.endTime = new Date('2027-01-16T11:00:00');
// Remove
scheduler.data.removeEvent(event);Color Resolution
Event colors are resolved in this priority order:
Priority
| 1. event.color | If set, uses the event's own color index. |
| 2. resource.color | If set, uses the resource's color index. |
| 3. Resource order | Falls back to the resource's position in the list. |
Custom Properties
Both resources and events support custom properties for storing application-specific data.
// Add custom properties to a resource
resource.addProperty(new CustomProperty('department', 'Engineering'));
resource.addProperty(new CustomProperty('skills', ['TypeScript', 'React']));
// Read & write
console.log(resource.getPropertyValue('department'));
resource.setPropertyValue('department', 'Design');
// Custom properties on events
event.addProperty(new CustomProperty('priority', 'high'));
console.log(event.getPropertyValue('priority'));
// Remove
const prop = resource.getPropertyByName('department');
resource.removeProperty(prop);