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.

432 B
Raw Blame
export type OwnedEntry = {
  readonly userId: string | null;
  readonly startTime: string;
  readonly endTime: string | null;
};

export function runningEntries<E extends OwnedEntry>(
  entries: ReadonlyArray<E>,
  userId: string,
): E[] {
  return entries
    .filter((entry) => entry.endTime === null && entry.userId === userId)
    .sort(
      (left, right) => Date.parse(right.startTime) - Date.parse(left.startTime),
    );
}