mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
Move getDaysPassed to utils
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
+1
-7
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user