TimelineKit

Data

Resources

Resources represent the entities being scheduled — people, rooms, equipment, or vehicles. Each resource is displayed as a row.

Resource Types

personA person / team member.
roomA meeting room or space.
equipmentEquipment / hardware.
vehicleA vehicle.

Resource Properties

id: stringUnique identifier (read-only).
name: stringDisplay name of the resource.
type: string | null'person' | 'room' | 'equipment' | 'vehicle' (or custom).
color: ColorValue | nullColor index or custom ColorDefinition. When set, all events for this resource use this color.
avatarUrl: string | nullURL to an avatar image (displayed in the sheet row).
filtered: booleanWhether 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: stringUnique identifier (read-only).
resourceId: stringID of the resource this event belongs to.
name: stringDisplay name of the event.
startTime: DateStart date/time.
endTime: DateEnd date/time.
color: ColorValue | nullColor override (overrides resource color). Can be a theme index or custom ColorDefinition.
data: anyArbitrary user data attached to the event. Not serialized — lost during save()/load().
durationMs: numberDuration in milliseconds (read-only).
durationHours: numberDuration 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.colorIf set, uses the event's own color index.
2. resource.colorIf set, uses the resource's color index.
3. Resource orderFalls 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);