feat: 그날 코디 계절감 — 구간을 아침 체감·낮 최고 평균으로, 쌀쌀한 날부터 겉옷 있는 스냅만·미니·뮬/슬링백 제외, 여자 코디는 고프코어 감점

This commit is contained in:
minaChoi committed 2026-10-27 10:02:29 +09:00
1 parent d8c406b8b8
commit b8117f190d
2 files changed
+18 -6

No files matched your search

+5 -2
View File
@@ -22,8 +22,11 @@ export async function weatherToday() {
const day = withTemp.filter((s) => hour(s) >= 6 && hour(s) <= 21)
const t = day.length ? day : withTemp
const maxC = Math.round(Math.max(...t.map((s) => s.temp_c)))
const morningC = Math.round((t.find((s) => hour(s) === 6) ?? t[0]).temp_c)
const band = spec.bands.find((b) => maxC >= b.from) ?? spec.bands[spec.bands.length - 1]
const morning = t.find((s) => hour(s) === 6) ?? t[0]
const morningC = Math.round(morning.temp_c)
// 낮 최고만 보면 아침·저녁 추위를 놓친다: 아침 체감과 낮 최고의 평균으로 구간을 정한다
const feelC = ((morning.feels_c ?? morning.temp_c) + maxC) / 2
const band = spec.bands.find((b) => feelC >= b.from) ?? spec.bands[spec.bands.length - 1]
return { day: d.day, morningC, maxC, band: band.id, layering: band.layering ?? '' }
}