(str)
| 20 | } |
| 21 | |
| 22 | export function parseDateTime(str) { |
| 23 | let d; |
| 24 | if(str.endsWith("Z") || str.match(TIMEZONE_REGEX)) { |
| 25 | d = Temporal.Instant.from(str, { |
| 26 | overflow: "reject" |
| 27 | }); |
| 28 | } else { |
| 29 | d = Temporal.PlainDateTime.from(str, { |
| 30 | overflow: "reject" |
| 31 | }); |
| 32 | } |
| 33 | |
| 34 | let timestamp = convertTemporalToTimestamp(d); |
| 35 | return new Date(timestamp).toUTCString(); |
| 36 | } |
| 37 | |
| 38 | export function parse(str) { |
| 39 | let result; |
no test coverage detected