(date: Date)
| 127 | startDate.setDate(startDate.getDate() - days); |
| 128 | |
| 129 | const formatDateForApi = (date: Date) => { |
| 130 | const year = date.getFullYear(); |
| 131 | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| 132 | const day = String(date.getDate()).padStart(2, '0'); |
| 133 | return `${year}${month}${day}`; |
| 134 | } |
| 135 | |
| 136 | // Fetch both in parallel for better performance |
| 137 | const [statsResult, sessionResult] = await Promise.all([ |