Skip to content

Commit

Permalink
[from now] 2024/03/01 19:41:48
Browse files Browse the repository at this point in the history
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
kawamataryo committed Mar 1, 2024
1 parent 3f0520c commit 5a81e82
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import dayjs from "dayjs";
import timezone from "dayjs/plugin/timezone";
import utc from "dayjs/plugin/utc";
import { InteractionType } from "discord-interactions";
import { Hono } from "hono";
import checkinCommand from "./interactions/applicationCommands/checkin";
Expand All @@ -12,6 +15,10 @@ import { EventsToCheckinsRepository } from "./repositories/eventsToCheckinsRepos
import { UsersRepository } from "./repositories/usersRepository";
import { errorResponse } from "./responses/errorResponse";

dayjs.extend(utc);
dayjs.extend(timezone);
dayjs.tz.setDefault("Asia/Tokyo");

type Bindings = {
DB: D1Database;
};
Expand Down
10 changes: 9 additions & 1 deletion src/scheduled.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5a81e82

Please sign in to comment.