From 73050662fbbb8757ed594fd14fc3fd43cb5668ce Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 8 Jun 2024 18:03:15 +0700 Subject: [PATCH] bug is already fix --- src/components/module/event/eventCard.tsx | 4 ++++ src/components/module/event/eventModule.tsx | 2 ++ src/components/module/event/githubCarousel.tsx | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/module/event/eventCard.tsx b/src/components/module/event/eventCard.tsx index f6a02eb..e595658 100644 --- a/src/components/module/event/eventCard.tsx +++ b/src/components/module/event/eventCard.tsx @@ -13,6 +13,8 @@ export default function EventCard(props: any) { description, onChildClick, avatar = 'https://avatars.githubusercontent.com/u/66357924?v=4', + due_date, + coin, } = props; const [modalOpen, setModalOpen] = useState(false); const cardRef = useRef(); @@ -32,6 +34,8 @@ export default function EventCard(props: any) { description={description} ref={cardRef} setModalOpen={setModalOpen} + coin={coin} + due_date={due_date} /> )} ); })} diff --git a/src/components/module/event/githubCarousel.tsx b/src/components/module/event/githubCarousel.tsx index 470f8ca..5fe74ab 100644 --- a/src/components/module/event/githubCarousel.tsx +++ b/src/components/module/event/githubCarousel.tsx @@ -43,7 +43,7 @@ export default function GitHubCarousel(props: any) { const dueDateTimestamp = new Date(due_date).getTime(); const currentTimestamp = Date.now(); const differenceInMilliseconds = dueDateTimestamp - currentTimestamp; - setDueDate(Math.max(Math.floor(differenceInMilliseconds / (1000 * 60 * 60 * 24)),0)); + setDueDate(Math.max(Math.ceil(differenceInMilliseconds / (1000 * 60 * 60 * 24)),0)); };