Skip to content

Commit

Permalink
fix: 방 상세페이지 날짜 오류 수정 (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
chasj0326 authored Jan 3, 2024
1 parent 76d6758 commit 1886004
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/domain/RoomDetail/components/RoomDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ const RoomDetail = ({
checkedRoomJoin,
serverTime
}: RoomDetailProps) => {
const todayDateString = `${(serverTime || new Date()).getFullYear()}-${
(serverTime || new Date()).getMonth() + 1
}-${(serverTime || new Date()).getDate() < 10 ? 0 : ''}${(
serverTime || new Date()
).getDate()}`;
const todayDate = serverTime || new Date();
const todayDateString = `${todayDate.getFullYear()}-${String(
todayDate.getMonth() + 1
).padStart(2, '0')}-${
todayDate.getDate() < 10 ? 0 : ''
}${todayDate.getDate()}`;

const { data: roomDetailData, status } = useQuery({
...roomOptions.detailByDate(roomId, todayDateString),
Expand Down
6 changes: 4 additions & 2 deletions src/domain/RoomDetail/components/RoomDetailContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ const RoomDetailContainer = ({ roomDetailData }: RoomDetailContainerProps) => {
const {
params: { roomId }
} = useRouteData();
const chooseDateString = `${chooseDate.getFullYear()}-${
const chooseDateString = `${chooseDate.getFullYear()}-${String(
chooseDate.getMonth() + 1
}-${chooseDate.getDate() < 10 ? 0 : ''}${chooseDate.getDate()}`;
).padStart(2, '0')}-${
chooseDate.getDate() < 10 ? 0 : ''
}${chooseDate.getDate()}`;

const { data: roomDetailDataByDate, status } = useQuery({
...roomOptions.detailByDate(roomId, chooseDateString)
Expand Down
4 changes: 2 additions & 2 deletions src/domain/RoomDetail/components/RoomWorkspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ const RoomWorkspace = ({
</div>
</>
) : (
<div className="mb-[2.12rem] flex h-[2.56rem] w-full items-center justify-center rounded-[62.43rem] bg-light-point dark:bg-dark-point">
<div className="mb-[2.12rem] flex h-[2.56rem] w-full items-center justify-center rounded-[62.43rem] bg-light-point dark:bg-dark-point-hover">
<Link
to={`log/${chooseDateString}`}
className="flex w-fit items-center text-base"
className="flex w-fit items-center text-base text-white"
state={{
todayCertificateRank,
routines,
Expand Down

0 comments on commit 1886004

Please sign in to comment.