Skip to content

Commit

Permalink
feat(QYOG-126): 지원기간 dayjs 사용해서 포맷팅 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
pho9902 committed May 18, 2024
1 parent 6e215d8 commit e9b6047
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/containers/Club/Apply/Apply.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 (
<S.Wrap horizonAlign="center">
<S.HeadDiv>
Expand All @@ -43,13 +45,10 @@ export default function Apply({ clubID }: { clubID: number }) {

<S.ApplyDuration>
<Typography typoSize="Head12" typoColor="accent_30">
지원기간{" "}
{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") : "-"}
`}
</Typography>
</S.ApplyDuration>
</S.ClubInfo>
Expand Down

0 comments on commit e9b6047

Please sign in to comment.