(d)
| 3 | const TIMEZONE_REGEX = /([+-]\d{2}):?(\d{2})?$/; |
| 4 | |
| 5 | function convertTemporalToTimestamp(d) { |
| 6 | // for Temporal.Instant |
| 7 | if(d.epochMilliseconds) { |
| 8 | return d.epochMilliseconds; |
| 9 | } |
| 10 | |
| 11 | // PlainDate and PlainDateTime |
| 12 | return Date.UTC(d.year, d.month-1, d.day, d.hour || 0, d.minute || 0, d.second || 0, d.millisecond || 0); |
| 13 | } |
| 14 | |
| 15 | export function parseDate(str) { |
| 16 | let d = Temporal.PlainDate.from(str, { |
no outgoing calls
no test coverage detected