fix: calendar strip NaN days and 3-day weather forecast

This commit is contained in:
2026-06-29 20:37:50 -05:00
parent e0a82b945f
commit 8cc1d4bb96
2 changed files with 80 additions and 18 deletions
+16
View File
@@ -45,6 +45,22 @@ export async function GET() {
weathercode: daily.weathercode?.[0],
summary: codeMap[daily.weathercode?.[0]] || 'Unknown',
},
tomorrow: {
maxC: celsius(daily.temperature_2m_max?.[1]),
minC: celsius(daily.temperature_2m_min?.[1]),
maxF: fahrenheit(daily.temperature_2m_max?.[1]),
minF: fahrenheit(daily.temperature_2m_min?.[1]),
weathercode: daily.weathercode?.[1],
summary: codeMap[daily.weathercode?.[1]] || 'Unknown',
},
dayAfter: {
maxC: celsius(daily.temperature_2m_max?.[2]),
minC: celsius(daily.temperature_2m_min?.[2]),
maxF: fahrenheit(daily.temperature_2m_max?.[2]),
minF: fahrenheit(daily.temperature_2m_min?.[2]),
weathercode: daily.weathercode?.[2],
summary: codeMap[daily.weathercode?.[2]] || 'Unknown',
},
},
});
} catch (error: any) {