MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / fmtTime

Function fmtTime

dashboard/lcm/src/helpers.ts:36–46  ·  view source on GitHub ↗
(epoch: any)

Source from the content-addressed store, hash-verified

34}
35
36export function fmtTime(epoch: any): string {
37 const v = Number(epoch);
38 if (!v) return "";
39 try {
40 const d = new Date(v * 1000);
41 if (isoTimeAgo) return isoTimeAgo(d.toISOString());
42 return d.toLocaleString();
43 } catch (e) {
44 return String(epoch);
45 }
46}
47
48export function fmtAbsoluteTime(epoch: any): string {
49 const v = Number(epoch);

Callers 1

TimeTextFunction · 0.90

Calls 1

isoTimeAgoFunction · 0.85

Tested by

no test coverage detected