MCPcopy Create free account
hub / github.com/IAmUnbounded/devctx / getTimeAgo

Function getTimeAgo

devctx/src/commands/diff.ts:5–13  ·  view source on GitHub ↗
(timestamp: string)

Source from the content-addressed store, hash-verified

3import { getCurrentBranch, getChangedFiles, getStagedFiles } from "../core/git";
4
5function getTimeAgo(timestamp: string): string {
6 const diff = Date.now() - new Date(timestamp).getTime();
7 const minutes = Math.floor(diff / 60000);
8 if (minutes < 60) return `${minutes} minutes ago`;
9 const hours = Math.floor(minutes / 60);
10 if (hours < 24) return `${hours} hours ago`;
11 const days = Math.floor(hours / 24);
12 return `${days} days ago`;
13}
14
15export async function diffCommand() {
16 if (!(await isInitialized())) {

Callers 1

diffCommandFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected