From 7864625bdd8e3f289695178c95d2d82c0b8d4d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=95=94=EB=83=A5=20=28imnyang=29?= Date: Tue, 10 Mar 2026 06:29:46 +0900 Subject: [PATCH] Update index.ts --- app/index.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/index.ts b/app/index.ts index eee32ec..811efc9 100644 --- a/app/index.ts +++ b/app/index.ts @@ -3,11 +3,17 @@ import { Meal, Timetable } from "./lib/discord"; async function main() { // Tomorrow is 1st of the month - const today = new Date(); - const YYMMDD = today.toISOString().slice(0, 10).replace(/-/g, "").toString(); - // const YYMMDD = "20250306"; - const weekday = today.getDay() === 0 ? 6 : today.getDay() - 1; - // const weekday = 2; + // 한국 시간 기준으로 날짜 객체 생성 + const now = new Date(new Date().toLocaleString("en-US", { timeZone: "Asia/Seoul" })); + + const YYYY = now.getFullYear(); + const MM = String(now.getMonth() + 1).padStart(2, '0'); + const DD = String(now.getDate()).padStart(2, '0'); + const YYMMDD = `${YYYY}${MM}${DD}`; + + // getDay(): 일(0) ~ 토(6) + // comcigan.ts 라이브러리 기준에 맞춰 weekday 설정 필요 + const weekday = now.getDay(); console.log("📅 | date:", YYMMDD); console.log("📅 | weekday:", weekday);