(value: string)
| 147 | } |
| 148 | |
| 149 | function parseEnglishUtcDate(value: string): number | null { |
| 150 | const match = normalizeSpaces(value).match( |
| 151 | /^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday),\s+([A-Za-z]+)\s+(\d{1,2}),\s+(\d{4})\s+at\s+(\d{1,2}):(\d{2}):(\d{2})\s+(AM|PM)\s+UTC$/i |
| 152 | ) |
| 153 | if (!match) return null |
| 154 | |
| 155 | const monthIndex = ENGLISH_MONTHS.get(match[1].toLowerCase()) |
| 156 | if (monthIndex === undefined) return null |
| 157 | |
| 158 | let hour = Number(match[4]) |
| 159 | if (hour < 1 || hour > 12) return null |
| 160 | if (match[7].toUpperCase() === 'AM') { |
| 161 | if (hour === 12) hour = 0 |
| 162 | } else if (hour !== 12) { |
| 163 | hour += 12 |
| 164 | } |
| 165 | |
| 166 | return createUtcTimestamp(Number(match[3]), monthIndex, Number(match[2]), hour, Number(match[5]), Number(match[6])) |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * Google Takeout 会根据导出语言生成本地化日期文本。这里只接受已验证的 |
no test coverage detected