fix: calendar strip NaN days and 3-day weather forecast
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user