{#if daily} {#if canExtendPast && onExtendPast}
3
{m.strip_past_label()}
{:else if locationRoute}
{m.strip_history_label()}
{/if}
{#each daily.dailyDates as time, index (index)} {@const selected = isSameDayInZone(time, selectedDay, daily.timezone)} {@const tempMax = daily.daily.temperature_2m_max[index]} {@const tempMin = daily.daily.temperature_2m_min[index]} {@const wCode = daily.daily.weather_code[index]} {@const dayCode = daily.dayCodes?.[index] ?? wCode} {@const nightCode = daily.nightCodes?.[index] ?? wCode} {@const precipSum = daily.daily.precipitation_sum[index]} {@const windMax = daily.daily.windspeed_10m_max[index]} {@const gustMax = daily.daily.windgusts_10m_max[index]} {@const windDir = daily.daily.winddirection_10m_dominant[index]} {@const sunDuration = daily.daily.sunshine_duration[index]} {@const daylightSec = Math.max( 0, (daily.daily.sunset[index] ?? 0) - (daily.daily.sunrise[index] ?? 0) )} {@const sunColor = getSunshineColor(sunDuration, daylightSec)} {@const sunPct = getSunshinePercent(sunDuration, daylightSec)} {@const lowSun = !sunIsSignificant(sunDuration, daylightSec)} {@const maxStyle = getTempStyle(tempMax, String(units.temperature_unit))} {@const lowPrecip = !precipIsSignificant(precipSum, String(units.precipitation_unit))} {@const lowWind = !windIsSignificant(windMax, gustMax, String(units.wind_speed_unit))} {@const relLabel = getRelativeDayLabel(time, daily.timezone)} {@const isToday = relLabel === 'Today'} {#if tempMax != null && !isNaN(tempMax) && !(tempMax === 0 && tempMin === 0)}
onSelectDay(time, index)} >
{formatZoned(time, daily.timezone, 'EEE').toUpperCase()}
{formatZoned(time, daily.timezone, 'd')}
{relLabel}
{tempMax.toFixed(0)}°
{tempMin.toFixed(0)}°
{Number((sunDuration ?? 0) / 3600).toFixed(0)}h
{Number(precipSum ?? 0).toFixed(precipSum >= 10 ? 0 : 1)}
{#if windDir != null && !isNaN(windDir)}
{:else}
{/if}
{windMax?.toFixed(0) ?? '-'}
-{gustMax?.toFixed(0) ?? '-'}
{/if} {/each} {#if canExtend && onExtend}
15
{m.strip_days_label()}
{:else if locationRoute}
{m.strip_seasonal_label()}
{/if}
{:else}
{#each SKELETON_CELLS as i (i)}
{/each}
{/if}