From e9b6047058c0c3d41424607721da7b6cb549f914 Mon Sep 17 00:00:00 2001 From: woo Date: Sat, 18 May 2024 15:39:01 +0900 Subject: [PATCH] =?UTF-8?q?feat(QYOG-126):=20=EC=A7=80=EC=9B=90=EA=B8=B0?= =?UTF-8?q?=EA=B0=84=20dayjs=20=EC=82=AC=EC=9A=A9=ED=95=B4=EC=84=9C=20?= =?UTF-8?q?=ED=8F=AC=EB=A7=B7=ED=8C=85=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/containers/Club/Apply/Apply.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/containers/Club/Apply/Apply.tsx b/src/containers/Club/Apply/Apply.tsx index 8094504..d6f0a1f 100644 --- a/src/containers/Club/Apply/Apply.tsx +++ b/src/containers/Club/Apply/Apply.tsx @@ -12,6 +12,7 @@ import { useQuery } from "@tanstack/react-query"; import { Typography } from "@/components/Utilities"; import Image from "next/image"; import { Button } from "@/components/Design"; +import dayjs from "dayjs"; export default function Apply({ clubID }: { clubID: number }) { const router = useRouter(); @@ -26,7 +27,8 @@ export default function Apply({ clubID }: { clubID: number }) { const { data: detail } = useClubDetail(clubID); if (!data) return; - + const startDate = dayjs(data.clubApplicationForm.startsAt); + const endDate = dayjs(data.clubApplicationForm.endsAt); return ( @@ -43,13 +45,10 @@ export default function Apply({ clubID }: { clubID: number }) { - 지원기간{" "} - {data.clubApplicationForm.startsAt - ? data.clubApplicationForm.startsAt.substring(0, 10) - : "-"} - {data.clubApplicationForm.endsAt - ? data.clubApplicationForm.endsAt.substring(0, 10) - : "-"} + {`지원기간 ${ + startDate.isValid() ? startDate.format("yyyy.mm.dd") : "-" + } ~ ${endDate.isValid() ? endDate.format("yyyy.mm.dd") : "-"} + `}