Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

486 B
Raw Blame
import type { TaskEntityWithProperties } from '@entity';
import { SYSTEM_PROPERTY_IDS } from '@property/identifiers';

/** Timeline dates come from the existing task payload, not another query. */
export function taskGanttDates(task: TaskEntityWithProperties) {
  const due = task.properties?.find(
    (property) => property.definition.id === SYSTEM_PROPERTY_IDS.DUE_DATE
  )?.value;

  return {
    start: task.createdAt,
    end: due?.type === 'Date' ? due.value : undefined,
  };
}