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

Function formatLastActive

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

Source from the content-addressed store, hash-verified

148const GENERIC_INVITE_ERROR = "Failed to send invitation. Please try again.";
149
150function formatLastActive(lastActiveAt: string | null): string {
151 if (!lastActiveAt) return "—";
152 const date = new Date(lastActiveAt);
153 const diffMins = Math.floor((Date.now() - date.getTime()) / 60000);
154 if (diffMins < 1) return "Just now";
155 if (diffMins < 60) return `${diffMins}m ago`;
156 const diffHours = Math.floor(diffMins / 60);
157 if (diffHours < 24) return `${diffHours}h ago`;
158 const diffDays = Math.floor(diffHours / 24);
159 if (diffDays < 30) return `${diffDays}d ago`;
160 return date.toLocaleDateString(undefined, { month: "short", day: "numeric" });
161}
162
163export function OrgPage(props: {
164 domainsSection?: React.ReactNode;

Callers 1

OrgPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected