(value: any)
| 32 | } |
| 33 | |
| 34 | function toDateValue(value: any): Date | null { |
| 35 | if (value instanceof Date) { |
| 36 | return Number.isNaN(value.getTime()) ? null : value |
| 37 | } |
| 38 | |
| 39 | if (typeof value === `string` || typeof value === `number`) { |
| 40 | const parsed = new Date(value) |
| 41 | return Number.isNaN(parsed.getTime()) ? null : parsed |
| 42 | } |
| 43 | |
| 44 | return null |
| 45 | } |
| 46 | |
| 47 | function evaluateStrftime(format: string, date: Date): string { |
| 48 | if (format === `%Y-%m-%d`) { |