Weather | Open-Meteo.com
{#if fetchedDaily} {#each fetchedDaily.dailyDates as time, index (index)} {@const selected = time.getDate() === selectedDay.getDate()} {@const tempMax = fetchedDaily.daily.temperature_2m_max[index]} {@const tempMin = fetchedDaily.daily.temperature_2m_min[index]} {@const wCode = fetchedDaily.daily.weather_code[index]} {@const sunDuration = fetchedDaily.daily.sunshine_duration[index]} {@const precipSum = fetchedDaily.daily.precipitation_sum[index]} {#if tempMax != null && !isNaN(tempMax)} {/if} {/each} {/if}

{selectedDay.toLocaleDateString('en-GB', { weekday: 'long' })} {selectedDay.getDate() === new Date(today.getTime() - 24 * 60 * 60 * 1000).getDate() ? ' (Yesterday)' : ''} {selectedDay.getDate() === today.getDate() ? ' (Today)' : ''} {selectedDay.getDate() === new Date(today.getTime() + 24 * 60 * 60 * 1000).getDate() ? ' (Tomorrow)' : ''}

{#each chartOptions as option, i (i)} {/each} {#if fetchedHourly} {@const hourly = fetchedHourly.hourly} {@const dates = fetchedHourly.hourlyDates}

Hourly Details

{#each dates as date, i (i)} {@const isNow = isCurrentHour(date)} {@const isMidnight = date.getHours() === 0} {/each} {#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} {#each dates as date, i (i)} {@const temp = hourly.temperature_2m[i]} {@const isNow = isCurrentHour(date)} {@const isMidnight = date.getHours() === 0} {/each} {#each dates as date, i (i)} {@const val = hourly.precipitation[i]} {@const isNow = isCurrentHour(date)} {@const isMidnight = date.getHours() === 0} {/each} {#each dates as date, i (i)} {@const prob = hourly.precipitation_probability[i]} {@const isNow = isCurrentHour(date)} {@const isMidnight = date.getHours() === 0} {/each} {#each dates as date, i (i)} {@const wind = hourly.windspeed_10m[i]} {@const isNow = isCurrentHour(date)} {@const isMidnight = date.getHours() === 0} {/each} {#each dates as date, i (i)} {@const hum = hourly.relative_humidity_2m[i]} {@const isNow = isCurrentHour(date)} {@const isMidnight = date.getHours() === 0} {/each} {#each dates as date, i (i)} {@const windDir = hourly.winddirection_10m[i]} {@const isNow = isCurrentHour(date)} {@const isMidnight = date.getHours() === 0} {/each}
Hourly weather details for {location.name}
Time {pad(date.getHours())}
Temperature {temp?.toFixed(1) ?? '-'}
Precipitation {val?.toFixed(1) ?? '-'}
Precip Prob. {prob?.toFixed(0) ?? '-'}
Wind {wind?.toFixed(0) ?? '-'}
Rel. Hum. {hum?.toFixed(0) ?? '-'}
Wind Dir. {#if windDir != null && !isNaN(windDir)}
{:else} - {/if}
{/if}
{#if fetchedDaily} {@const sunriseTs = fetchedDaily.daily.sunrise[selectedDayIndex]} {@const sunsetTs = fetchedDaily.daily.sunset[selectedDayIndex]} {#if sunriseTs && sunsetTs} {@const sunrise = new Date(sunriseTs * 1000)} {@const sunset = new Date(sunsetTs * 1000)}
Sunrise: {pad(sunrise.getHours())}:{pad(sunrise.getMinutes())}
Sunset: {pad(sunset.getHours())}:{pad(sunset.getMinutes())}
{/if} {/if}
{#if params.models && params.models.length > 0} {@const modelValue = params.models[0]} { if (params.models && val) { params.models = [val]; } }} > {modelSelected?.label} {#each models as mo (mo.value)} {mo.label} {/each} {/if}