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

Function getTimeAgo

devctx/src/core/prompt.ts:78–86  ·  view source on GitHub ↗
(timestamp: string)

Source from the content-addressed store, hash-verified

76}
77
78function getTimeAgo(timestamp: string): string {
79 const diff = Date.now() - new Date(timestamp).getTime();
80 const minutes = Math.floor(diff / 60000);
81 if (minutes < 60) return `${minutes} minutes ago`;
82 const hours = Math.floor(minutes / 60);
83 if (hours < 24) return `${hours} hours ago`;
84 const days = Math.floor(hours / 24);
85 return `${days} days ago`;
86}

Callers 1

generatePromptFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected