Update index.ts

This commit is contained in:
암냥 2026-03-10 06:29:46 +09:00 committed by GitHub
commit 7864625bdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,11 +3,17 @@ import { Meal, Timetable } from "./lib/discord";
async function main() { async function main() {
// Tomorrow is 1st of the month // Tomorrow is 1st of the month
const today = new Date(); // 한국 시간 기준으로 날짜 객체 생성
const YYMMDD = today.toISOString().slice(0, 10).replace(/-/g, "").toString(); const now = new Date(new Date().toLocaleString("en-US", { timeZone: "Asia/Seoul" }));
// const YYMMDD = "20250306";
const weekday = today.getDay() === 0 ? 6 : today.getDay() - 1; const YYYY = now.getFullYear();
// const weekday = 2; 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("📅 | date:", YYMMDD);
console.log("📅 | weekday:", weekday); console.log("📅 | weekday:", weekday);