* 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)
| 51 | * Example: "2026-03-16T00:00:00Z" → "Mar 16, 2026 at 12:00 AM" |
| 52 | */ |
| 53 | function 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. |
no outgoing calls
no test coverage detected