Use todayKst helper instead of manual KST offset in game-detail
- isGameDateInFuture에서 Date.now()+9h 수동 합성 대신 기존 todayKst() 사용 - 서버 TZ=Asia/Seoul 전제로 동작 동등, 코드베이스 시간 처리 컨벤션과 일치
This commit is contained in:
parent
fc285a54c6
commit
8be33be10f
@ -1,3 +1,4 @@
|
|||||||
|
import { todayKst } from "../types/dateString";
|
||||||
import { stripTags, decodeHtmlEntities } from "./html-utils";
|
import { stripTags, decodeHtmlEntities } from "./html-utils";
|
||||||
import { LeagueCode, LEAGUE_CODES } from "./game-list";
|
import { LeagueCode, LEAGUE_CODES } from "./game-list";
|
||||||
import { SERIES_ID } from "./schedule";
|
import { SERIES_ID } from "./schedule";
|
||||||
@ -769,12 +770,8 @@ function isGameDateInFuture(gameId: string): boolean {
|
|||||||
const m = gameId.match(/^(\d{4})(\d{2})(\d{2})/);
|
const m = gameId.match(/^(\d{4})(\d{2})(\d{2})/);
|
||||||
if (!m) return false;
|
if (!m) return false;
|
||||||
const gameDate = `${m[1]}-${m[2]}-${m[3]}`;
|
const gameDate = `${m[1]}-${m[2]}-${m[3]}`;
|
||||||
const nowKst = new Date(Date.now() + 9 * 60 * 60 * 1000);
|
// 서버 로컬시간 = KST(.env의 TZ=Asia/Seoul)이므로 기존 KST 헬퍼로 충분.
|
||||||
const today =
|
return gameDate > todayKst();
|
||||||
`${nowKst.getUTCFullYear()}-` +
|
|
||||||
`${String(nowKst.getUTCMonth() + 1).padStart(2, "0")}-` +
|
|
||||||
`${String(nowKst.getUTCDate()).padStart(2, "0")}`;
|
|
||||||
return gameDate > today;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── 5. 통합 GameDetail ──
|
// ── 5. 통합 GameDetail ──
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user