MCPcopy Index your code
hub / github.com/simstudioai/sim / toBrexDateTime

Function toBrexDateTime

apps/sim/tools/brex/utils.ts:59–65  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

57 * timestamps on these endpoints, so offsets are converted to UTC and stripped.
58 */
59export 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}

Callers 3

utils.test.tsFile · 0.90

Calls 1

testMethod · 0.80

Tested by

no test coverage detected