From 46979401b4e820cc22efa052fab032512ef0f50a Mon Sep 17 00:00:00 2001 From: jhj9109 Date: Fri, 29 Sep 2023 05:25:23 +0900 Subject: [PATCH] =?UTF-8?q?Update=20=EC=9D=B4=EC=A0=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EB=B6=84=20=EB=A1=A4=EB=B0=B1=20&=20=EC=82=AC?= =?UTF-8?q?=EC=84=9C=20=EB=8B=AC=EB=A0=A5=EC=AA=BD=EC=97=90=20=EC=97=85?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rotation.tsx 기존 업데이트는 사서 신청 부분 - 사서 달력쪽 업데이트가 의도가 맞는데 명백한 실수... Calendar.tsx - 이 파일이 사서달력 관련 파일 - isWeekend 요소는 isSunday로 수정 --- src/components/Rotation/Calendar.tsx | 10 ++++++---- src/components/Rotation/Rotation.tsx | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/Rotation/Calendar.tsx b/src/components/Rotation/Calendar.tsx index dce45f0..7a0e470 100644 --- a/src/components/Rotation/Calendar.tsx +++ b/src/components/Rotation/Calendar.tsx @@ -11,6 +11,7 @@ import { getToken } from '@cert/TokenStorage'; import errorAlert from '@globalObj/function/errorAlert'; import '@css/Rotation/Calendar.scss'; import { getAuth } from '@cert/AuthStorage'; +import { DAY_OF_SUNDAY } from './rotation_utils'; const COLOR = { me: '#e79f5a', @@ -65,15 +66,16 @@ export default class Calendar extends React.Component { /* 동일 달 여부 => 기본적으로 같은 달안에서 이루어진다. 주말 여부 => 0인 일요일과 6인 토요일은 6으로 나누면 0 + => 2024.09.29: 일요일 여부로 수정 중복 여부(해당일자에 이미 사서 추가된 상태) => 날짜 & title(인트라id)를 비교 공휴일 여부 => 하고 싶다면 공휴일 정보는 미리 가져와서 추가 해야됨 */ dropEventAllowHandler = (dropInfo, draggedEvent) => { const { currentEvents } = this.state; const isSameMonth = draggedEvent.start.getMonth() === dropInfo.start.getMonth(); - const isWeekend = dropInfo.start.getDay() % 6 === 0; + const isSunday = dropInfo.start.getDay() === DAY_OF_SUNDAY; const isDuplicated = currentEvents.some((e) => e.startStr === dropInfo.startStr && e.title === draggedEvent.title); - return isSameMonth && !isWeekend && !isDuplicated; + return isSameMonth && !isSunday && !isDuplicated; }; handleWeekendsToggle = () => { @@ -89,8 +91,8 @@ export default class Calendar extends React.Component { }; handleDateClick = (info) => { - const isWeekend = info.date.getDay() % 6 === 0; - if (isWeekend) { + const isSunday = info.date.getDay() === DAY_OF_SUNDAY; + if (isSunday) { return; } diff --git a/src/components/Rotation/Rotation.tsx b/src/components/Rotation/Rotation.tsx index ba97ab0..90f2b1a 100644 --- a/src/components/Rotation/Rotation.tsx +++ b/src/components/Rotation/Rotation.tsx @@ -246,7 +246,7 @@ const SelectDateBox = ({ activeStartDate={getActiveStartDate(currentDate)} minDate={setLimitMinDate(currentDate)} maxDate={setLimitMaxDate(currentDate)} - tileDisabled={setTileDisabled([rules.exceptSunday])} + tileDisabled={setTileDisabled([rules.weekdayOnly])} tileClassName={setTileClassName} onClickDay={onClickDay} >