Weather | Open-Meteo.com
{#await weatherDaily then wd} {#each wd.daily.time as time, index (index)} {@const selected = time.getDate() === selectedDay.getDate()} {#if !isNaN(wd.daily.temperature_2m_max.values(index).toFixed(1))} {/if} {/each} {:catch error}

{error.message}

{/await}

{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)' : ''}

{#await weather then weather} {#each weather.indexes as index, j (j)} {/each} {#each weather.indexes as index, j (j)} {@const now = weather.hourlyTime[index].getDate() === today.getDate() && weather.hourlyTime[index].getHours() === today.getHours()} {/each} {#each weather.indexes as index, j (j)} {@const temp = weather.entries[0].values[index]} {#if !isNaN(temp)} {/if} {/each} {#each weather.entries as entry, i (i)} {#each weather.indexes as index, j (j)} {#if !isNaN(entry.values[index])} {/if} {/each} {/each} {#if winddir} {#each weather.indexes as index, j (j)} {#if !isNaN(weather.windDirections[index])} {/if} {/each} {/if} {/await}
Weather Week {location.name}
Time{weather.hourlyTime[index].getHours() < 10 ? '0' : ''}{weather.hourlyTime[ index ].getHours()}
Icons
Temp graph{temp.toFixed(0)}
{entry.title}{entry.name === 'precipitation' || entry.name === 'temperature_2m' ? entry.values[index].toFixed(1) : entry.values[index]}
Wind Dir.
{#await weatherDaily then wd} {@const sunrise = new Date(Number(wd.daily.sunrise.valuesInt64(selectedDayIndex)) * 1000)} {@const sunset = new Date(Number(wd.daily.sunset.valuesInt64(selectedDayIndex)) * 1000)}
Sunrise: {pad(sunrise.getHours())}:{pad(sunrise.getMinutes())}
Sunset: {pad(sunset.getHours())}:{pad(sunset.getMinutes())}
{/await}
{modelSelected?.label} {#each models as mo} {mo.label} {/each}
storedLocation.set(event.detail)} label="Search Location" />

Color scale example

{#if $params.temperature_unit == 'celsius'} {#each [...Array(101).keys()].map((i) => -40 + i) as temp}
= ($params.temperature_unit === 'celsius' ? 30 : 104) ? 'white' : 'black'}`} > {temp} °C
{getColor(temp, $params.temperature_unit)}
{/each} {:else} {#each [...Array(91).keys()].map((i) => -40 + i * 2) as temp}
= ($params.temperature_unit === 'celsius' ? 30 : 104) ? 'white' : 'black'}`} > {temp} {$params.temperature_unit === 'celsius' ? '°C' : '°F'}
{getColor(temp, $params.temperature_unit)}
{/each} {/if}