* Create a DateValue from an ISO date string (YYYY-MM-DD).
(iso: string)
| 58 | * Create a DateValue from an ISO date string (YYYY-MM-DD). |
| 59 | */ |
| 60 | public static fromString(iso: string): DateValue | null { |
| 61 | const match = iso.match(/^(\d{4})-(\d{2})-(\d{2})$/); |
| 62 | if (!match || !match[1] || !match[2] || !match[3]) return null; |
| 63 | const year = parseInt(match[1], 10); |
| 64 | const month = parseInt(match[2], 10); |
| 65 | const day = parseInt(match[3], 10); |
| 66 | return new DateValue(year, month, day); |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Create a DateValue from a map of components. |
no outgoing calls
no test coverage detected