Update index.ts

This commit is contained in:
암냥 2026-03-09 22:10:08 +09:00 committed by GitHub
commit 6e092c032d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,11 +3,10 @@ import { Meal, Timetable } from "./lib/discord";
async function main() {
// Tomorrow is 1st of the month
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
const YYMMDD = tomorrow.toISOString().slice(0, 10).replace(/-/g, "").toString();
const today = new Date();
const YYMMDD = today.toISOString().slice(0, 10).replace(/-/g, "").toString();
// const YYMMDD = "20250306";
const weekday = tomorrow.getDay() === 0 ? 6 : tomorrow.getDay() - 1;
const weekday = today.getDay() === 0 ? 6 : tomorrow.getDay() - 1;
// const weekday = 2;
console.log("📅 | date:", YYMMDD);
@ -45,4 +44,4 @@ async function main() {
main().catch((error) => {
console.error("Error in main function:", error);
process.exit(1);
});
});