MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / formatLastActive

Function formatLastActive

packages/react/src/pages/org.tsx:133–144  ·  view source on GitHub ↗
(lastActiveAt: string | null)

Source from the content-addressed store, hash-verified

131const GENERIC_INVITE_ERROR = "Failed to send invitation. Please try again.";
132
133function formatLastActive(lastActiveAt: string | null): string {
134 if (!lastActiveAt) return "—";
135 const date = new Date(lastActiveAt);
136 const diffMins = Math.floor((Date.now() - date.getTime()) / 60000);
137 if (diffMins < 1) return "Just now";
138 if (diffMins < 60) return `${diffMins}m ago`;
139 const diffHours = Math.floor(diffMins / 60);
140 if (diffHours < 24) return `${diffHours}h ago`;
141 const diffDays = Math.floor(diffHours / 24);
142 if (diffDays < 30) return `${diffDays}d ago`;
143 return date.toLocaleDateString(undefined, { month: "short", day: "numeric" });
144}
145
146export function OrgPage(props: {
147 domainsSection?: React.ReactNode;

Callers 1

OrgPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected