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