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

Function formatDate

packages/react/src/pages/api-keys.tsx:44–54  ·  view source on GitHub ↗
(value: string | null)

Source from the content-addressed store, hash-verified

42type CreatedKey = ApiKeySummary & { readonly value: string };
43
44const formatDate = (value: string | null): string => {
45 if (!value) return "Never";
46 const date = new Date(value);
47 return Number.isNaN(date.getTime())
48 ? value
49 : new Intl.DateTimeFormat(undefined, {
50 month: "short",
51 day: "numeric",
52 year: "numeric",
53 }).format(date);
54};
55
56const defaultApiKeyName = (): string =>
57 `API key ${new Intl.DateTimeFormat(undefined, {

Callers 1

ApiKeysPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected