MCPcopy Create free account
hub / github.com/coder/coder / formatResetDate

Function formatResetDate

site/src/pages/AgentsPage/utils/usageLimitMessage.ts:53–65  ·  view source on GitHub ↗

* Format a resets_at RFC3339 timestamp into a user-friendly string. * Example: "2026-03-16T00:00:00Z" → "Mar 16, 2026 at 12:00 AM"

(isoString: string)

Source from the content-addressed store, hash-verified

51 * Example: "2026-03-16T00:00:00Z""Mar 16, 2026 at 12:00 AM"
52 */
53function formatResetDate(isoString: string): string {
54 const date = new Date(isoString);
55 if (Number.isNaN(date.getTime())) {
56 return "";
57 }
58 return date.toLocaleDateString("en-US", {
59 month: "short",
60 day: "numeric",
61 year: "numeric",
62 hour: "numeric",
63 minute: "2-digit",
64 });
65}
66
67/**
68 * Runtime guard for the structured 409 usage-limit response.

Callers 1

formatUsageLimitMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected