Update index.ts
This commit is contained in:
parent
553fe8fb28
commit
7864625bdd
1 changed files with 11 additions and 5 deletions
16
app/index.ts
16
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue