改进METAR当日状态判断与展示

This commit is contained in:
2569718930@qq.com
2026-04-21 19:13:33 +08:00
parent 3901a9e967
commit 582ded8cfb
6 changed files with 230 additions and 84 deletions
+12
View File
@@ -1060,6 +1060,18 @@ export function getTemperatureChartData(
: `${metarFallbackTag}: ${airportRecentText}`,
);
}
if (detail.metar_status?.stale_for_today) {
const dateText = detail.metar_status.last_observation_local_date || "";
const tempText =
detail.metar_status.last_temp != null
? `${detail.metar_status.last_temp}${detail.temp_symbol}`
: "";
legendParts.push(
isEnglish(locale)
? `No same-day ${metarFallbackTag} report yet; latest report${dateText ? ` was ${dateText}` : ""}${tempText ? ` at ${tempText}` : ""}.`
: `今日暂无同日 ${metarFallbackTag} 报文;最近一报${dateText ? `${dateText}` : ""}${tempText ? `${tempText}` : ""}`,
);
}
if (shouldUseMetarFallback) {
legendParts.push(
isEnglish(locale)