Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

362 B
Raw Blame
type DateInput = string | Date;

export function importRunMinutes(
  createdAt: DateInput,
  finishedAt: DateInput | null,
): number | null {
  if (!finishedAt) return null;

  const elapsed =
    new Date(finishedAt).getTime() - new Date(createdAt).getTime();
  if (!Number.isFinite(elapsed)) return null;

  return Math.max(0, Math.round(elapsed / 60_000));
}