(value: string)
| 57 | * timestamps on these endpoints, so offsets are converted to UTC and stripped. |
| 58 | */ |
| 59 | export function toBrexDateTime(value: string): string { |
| 60 | const trimmed = value.trim() |
| 61 | if (!/(?:z|[+-]\d{2}:?\d{2})$/i.test(trimmed)) return trimmed |
| 62 | const parsed = new Date(trimmed) |
| 63 | if (Number.isNaN(parsed.getTime())) return trimmed |
| 64 | return parsed.toISOString().slice(0, 19) |
| 65 | } |
no test coverage detected