From f97e70ba9a58afc19bdc1660d7afdb667fbcdd79 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 14 Feb 2026 15:24:19 -0700 Subject: [PATCH] feat: Support CLR cloud condition and fix SKC altitude parsing Co-authored-by: aider (gemini/gemini-2.5-pro) --- metar.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/metar.html b/metar.html index fa37cfb..d9bac5f 100644 --- a/metar.html +++ b/metar.html @@ -152,13 +152,20 @@ function decodeClouds(code) { const coverMap = { 'SKC': 'Sky clear', + 'CLR': 'Sky clear', 'FEW': 'Few clouds', 'SCT': 'Scattered clouds', 'BKN': 'Broken clouds', 'OVC': 'Overcast clouds' }; - const cover = coverMap[code.substring(0, 3)]; + const coverType = code.substring(0, 3); + const cover = coverMap[coverType]; if (!cover) return `${code}: Unknown cloud information`; + + if (coverType === 'SKC' || coverType === 'CLR') { + return `${code}: ${cover}`; + } + const alt = parseInt(code.substring(3, 6)) * 100; return `${code}: ${cover} at ${alt.toLocaleString()} feet above ground`; }