Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
diff --git a/src/app.ts b/src/app.ts index 3ee67c6..c717ddc 100644 --- a/src/app.ts +++ b/src/app.ts @@ -11,6 +11,13 @@ import { EventsRepository } from "./repositories/eventsRepository"; import { EventsToCheckinsRepository } from "./repositories/eventsToCheckinsRepository"; import { UsersRepository } from "./repositories/usersRepository"; import { errorResponse } from "./responses/errorResponse"; +import dayjs from "dayjs"; +import timezone from "dayjs/plugin/timezone"; +import utc from "dayjs/plugin/utc"; + +dayjs.extend(utc); +dayjs.extend(timezone); +dayjs.tz.setDefault("Asia/Tokyo"); type Bindings = { DB: D1Database; diff --git a/src/scheduled.ts b/src/scheduled.ts index 04fbceb..1bbc4fc 100644 --- a/src/scheduled.ts +++ b/src/scheduled.ts @@ -1,5 +1,13 @@ +import dayjs from "dayjs"; +import timezone from "dayjs/plugin/timezone"; +import utc from "dayjs/plugin/utc"; import { DiscordClient } from "./clients/discord"; import { EventsRepository } from "./repositories/eventsRepository"; + +dayjs.extend(utc); +dayjs.extend(timezone); +dayjs.tz.setDefault("Asia/Tokyo"); + type Bindings = { DB: D1Database; DISCORD_TOKEN: string; @@ -27,7 +35,7 @@ const scheduled: ExportedHandler<Bindings>["scheduled"] = async ( }); } break; - case "50 8 * * * ": + case "50 8 * * *": if (isEventDay) { await client.sendMessage({ channelId: env.MOKUMOKU_CHANNEL_ID,
- Loading branch information