From 8be33be10f735e942c2c09e4bdf3c0a41ac57aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A4=EC=A0=95=EB=AF=BC?= Date: Fri, 26 Jun 2026 23:06:18 +0900 Subject: [PATCH] Use todayKst helper instead of manual KST offset in game-detail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - isGameDateInFuture에서 Date.now()+9h 수동 합성 대신 기존 todayKst() 사용 - 서버 TZ=Asia/Seoul 전제로 동작 동등, 코드베이스 시간 처리 컨벤션과 일치 --- src/kbo/game-detail.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/kbo/game-detail.ts b/src/kbo/game-detail.ts index 1a2908d..20709c8 100644 --- a/src/kbo/game-detail.ts +++ b/src/kbo/game-detail.ts @@ -1,3 +1,4 @@ +import { todayKst } from "../types/dateString"; import { stripTags, decodeHtmlEntities } from "./html-utils"; import { LeagueCode, LEAGUE_CODES } from "./game-list"; import { SERIES_ID } from "./schedule"; @@ -769,12 +770,8 @@ function isGameDateInFuture(gameId: string): boolean { const m = gameId.match(/^(\d{4})(\d{2})(\d{2})/); if (!m) return false; const gameDate = `${m[1]}-${m[2]}-${m[3]}`; - const nowKst = new Date(Date.now() + 9 * 60 * 60 * 1000); - const today = - `${nowKst.getUTCFullYear()}-` + - `${String(nowKst.getUTCMonth() + 1).padStart(2, "0")}-` + - `${String(nowKst.getUTCDate()).padStart(2, "0")}`; - return gameDate > today; + // 서버 로컬시간 = KST(.env의 TZ=Asia/Seoul)이므로 기존 KST 헬퍼로 충분. + return gameDate > todayKst(); } // ── 5. 통합 GameDetail ──