(type: Intl.DateTimeFormatPartTypes)
| 251 | |
| 252 | const parts = formatter.formatToParts(tentativeUTCDate) |
| 253 | const getPart = (type: Intl.DateTimeFormatPartTypes) => |
| 254 | parts.find((p) => p.type === type)?.value |
| 255 | |
| 256 | const formattedYear = Number.parseInt(getPart('year') || '0', 10) |
| 257 | const formattedMonth = Number.parseInt(getPart('month') || '0', 10) // 1-based |
no outgoing calls
no test coverage detected