From 55057564fadf6072b640b147ac90e60bd524ad5b Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Fri, 22 Jul 2022 12:08:00 +0200 Subject: [PATCH] Move getDaysPassed to utils Signed-off-by: Sebastian Martinez --- src/commit.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/commit.ts b/src/commit.ts index d3e4807d6..9ff488aad 100644 --- a/src/commit.ts +++ b/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) - ); -}