diff --git a/src/routes/weather/week/[location]/+page.svelte b/src/routes/weather/week/[location]/+page.svelte
index 79799b0..3bb4081 100644
--- a/src/routes/weather/week/[location]/+page.svelte
+++ b/src/routes/weather/week/[location]/+page.svelte
@@ -1,26 +1,39 @@
{error.message}
- {/await} + {/if} -| Time | - {#each weather.indexes as index, j (j)} +Time | + {#each dates as date, i (i)} + {@const isNow = isCurrentHour(date)} + {@const isMidnight = date.getHours() === 0}{weather.hourlyTime[index].getHours() < 10 ? '0' : ''}{weather.hourlyTime[ - index - ].getHours()} | - {/each} -
|---|---|---|
| Icons | - {#each weather.indexes as index, j (j)} - {@const now = - weather.hourlyTime[index].getDate() === today.getDate() && - weather.hourlyTime[index].getHours() === today.getHours()} -+ {pad(date.getHours())} + {/each} | |
| Temp graph | - {#each weather.indexes as index, j (j)} - {@const temp = weather.entries?.[0]?.values?.[index]} - - {#if temp !== undefined && !isNaN(temp)} -{temp?.toFixed(0)} | + + + {#each dates as date, i (i)} + {@const wCode = hourly.weather_code[i]} + {@const isNow = isCurrentHour(date)} + {@const daytime = isDaytimeHour(date.getHours())} + {@const isMidnight = date.getHours() === 0} ++ + | {/each}
| {entry.title} | - {#each weather.indexes as index, j (j)} - {#if entry.values && !isNaN(entry.values[index])} -{entry.name === 'precipitation' || entry.name === 'temperature_2m' - ? entry.values![index].toFixed(1) - : entry.values![index]} | - {/if} - {/each} -|
| Wind Dir. | +||
| Temperature | + {#each dates as date, i (i)} + {@const temp = hourly.temperature_2m[i]} + {@const isNow = isCurrentHour(date)} + {@const isMidnight = date.getHours() === 0} +- {#each weather.indexes as index, j (j)} - {#if weather.windDirections && !isNaN(weather.windDirections[index])} - | + {/each} + |
| Precipitation | + {#each dates as date, i (i)} + {@const val = hourly.precipitation[i]} + {@const isNow = isCurrentHour(date)} + {@const isMidnight = date.getHours() === 0} ++ {val?.toFixed(1) ?? '-'} + | + {/each} +|
| Precip Prob. | + {#each dates as date, i (i)} + {@const prob = hourly.precipitation_probability[i]} + {@const isNow = isCurrentHour(date)} + {@const isMidnight = date.getHours() === 0} ++ {prob?.toFixed(0) ?? '-'} + | + {/each} +|
| Wind | + {#each dates as date, i (i)} + {@const wind = hourly.windspeed_10m[i]} + {@const isNow = isCurrentHour(date)} + {@const isMidnight = date.getHours() === 0} ++ {wind?.toFixed(0) ?? '-'} + | + {/each} +|
| Rel. Hum. | + {#each dates as date, i (i)} + {@const hum = hourly.relative_humidity_2m[i]} + {@const isNow = isCurrentHour(date)} + {@const isMidnight = date.getHours() === 0} ++ {hum?.toFixed(0) ?? '-'} + | + {/each} +|
| Wind Dir. | + {#each dates as date, i (i)} + {@const windDir = hourly.winddirection_10m[i]} + {@const isNow = isCurrentHour(date)} + {@const isMidnight = date.getHours() === 0} +
+ {#if windDir != null && !isNaN(windDir)}
+
+ |
+
+
+ {:else}
+ -
{/if}
- {/each}
-