Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Move getDaysPassed to utils
Sebastian Martinez committed 3 years ago
commit 55057564fadf6072b640b147ac90e60bd524ad5b
parent cc5c45cf4368ac07042145ce0e5c369496dc1dc5
1 file changed +1 -7
modified src/commit.ts
@@ -1,6 +1,7 @@
import { Stats, Person, Project } from "@app/project";
import type { Diff } from "@app/diff";
import { ApiError } from "@app/api";
+
import { getDaysPassed } from "@app/utils";

export interface CommitsHistory {
  headers: CommitMetadata[];
@@ -186,10 +187,3 @@ export function groupCommitsByWeek(commits: CommitMetadata[]): CommitGroup[] {

  return groupedCommits;
}
-

-
// Get amount of days passed between two dates
-
function getDaysPassed(from: Date, to: Date): number {
-
  return Math.floor(
-
    (to.getTime() - from.getTime()) / (24 * 60 * 60 * 1000)
-
  );
-
}