(date: Date)
| 401 | * Extract the date portion (YYYY-MM-DD) from a Date object. |
| 402 | */ |
| 403 | export function toDateString(date: Date): string { |
| 404 | const parts = date.toISOString().split('T') |
| 405 | const dateStr = parts[0] |
| 406 | if (!dateStr) { |
| 407 | throw new Error('Invalid ISO date string') |
| 408 | } |
| 409 | return dateStr |
| 410 | } |
| 411 | |
| 412 | /** |
| 413 | * Get today's date in YYYY-MM-DD format. |
no outgoing calls
no test coverage detected