From 9f78d5b79f3c50e1820510af0ff126ff7cd26ba3 Mon Sep 17 00:00:00 2001 From: yamanoku <0910yama@gmail.com> Date: Tue, 16 Apr 2024 19:08:40 +0900 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=9C=AC=E6=99=82=E9=96=93=E8=A8=88?= =?UTF-8?q?=E7=AE=97=E3=81=AB=E3=81=AA=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/islands/counter.tsx | 2 ++ app/routes/index.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/islands/counter.tsx b/app/islands/counter.tsx index 41f80273..ce7f5799 100644 --- a/app/islands/counter.tsx +++ b/app/islands/counter.tsx @@ -31,7 +31,9 @@ export default function Counter(props: InitialTime) { (Number(nextBirthday) - Number(now)) / 1000 ); const days = Math.floor(diffInSeconds / (60 * 60 * 24)); + // hoursを日本時間の24時間計算になるようにする const hours = Math.floor((diffInSeconds / (60 * 60)) % 24) - 9; + hours < 0 ? hours + 24 : hours; const minutes = Math.floor((diffInSeconds / 60) % 60); const seconds = diffInSeconds % 60; diff --git a/app/routes/index.tsx b/app/routes/index.tsx index 842a4165..d716a014 100644 --- a/app/routes/index.tsx +++ b/app/routes/index.tsx @@ -13,7 +13,9 @@ export default function Index() { const diffInSeconds = Math.floor((Number(nextBirthday) - Number(now)) / 1000); const days = Math.floor(diffInSeconds / (60 * 60 * 24)); + // hoursを日本時間の24時間計算になるようにする const hours = Math.floor((diffInSeconds / (60 * 60)) % 24) - 9; + hours < 0 ? hours + 24 : hours; const minutes = Math.floor((diffInSeconds / 60) % 60); const seconds = diffInSeconds % 60;