From f024bc55427f8340b954f60d865d84f74d686e17 Mon Sep 17 00:00:00 2001 From: sanguu Date: Mon, 26 Sep 2022 11:21:28 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=ED=96=89=20=EC=9D=B4=EB=A0=A5=20?= =?UTF-8?q?=ED=98=84=ED=99=A9(=EB=82=A0=EC=A7=9C=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis/history/AnalysisHistorySearch.js | 20 +++++++------------ .../history/AnalysisHistoryContainer.js | 6 +++--- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/components/analysis/history/AnalysisHistorySearch.js b/src/components/analysis/history/AnalysisHistorySearch.js index f38f970..e6a618d 100644 --- a/src/components/analysis/history/AnalysisHistorySearch.js +++ b/src/components/analysis/history/AnalysisHistorySearch.js @@ -13,25 +13,19 @@ import { } from 'reactstrap'; export const AnalysisHistorySearch = props => { - + useEffect(() => { - if(props.isClick!=0){ - props.setParams({ - ...props.params, - stDate: moment().subtract(props.dateType, 'day').format('YYYY-MM-DD'), - endDate: moment().subtract(0, 'day').format('YYYY-MM-DD'), - groupId: props.searchData.groupId - }); - } - else{ + if (props.isClick != -1) { + props.setParams({ ...props.params, - stDate: '', - endDate: '', + stDate: moment().subtract(props.dateType, 'day').format('YYYY-MM-DD'), + endDate: moment().subtract(0, 'day').format('YYYY-MM-DD'), groupId: props.searchData.groupId }); } - }, [props.dateType,props.isClick]); + + }, [props.dateType, props.isClick]); return ( diff --git a/src/containers/analysis/history/AnalysisHistoryContainer.js b/src/containers/analysis/history/AnalysisHistoryContainer.js index 43a6a58..dc2accb 100644 --- a/src/containers/analysis/history/AnalysisHistoryContainer.js +++ b/src/containers/analysis/history/AnalysisHistoryContainer.js @@ -26,8 +26,8 @@ export const AnalysisHistoryContainer = props => { state => state.analysisHistoryState ); const initSearchData = { - stDate: moment().subtract(1, 'day').format('YYYY-MM-DD'), - endDate: moment().subtract(0, 'day').format('YYYY-MM-DD'), + //stDate: moment().subtract(1, 'day').format('YYYY-MM-DD'), + //endDate: moment().subtract(0, 'day').format('YYYY-MM-DD'), // stDate: moment().set({ 'date': 1, 'h': 0, 'm': 0, 's': 0 }).format('YYYY-MM-DD HH:mm:ss'), // endDate: moment().set({ 'h': 23, 'm': 59, 's': 59 }).format('YYYY-MM-DD HH:mm:ss'), groupId: '' @@ -42,7 +42,7 @@ export const AnalysisHistoryContainer = props => { const { joinList, joinListCount } = useSelector(state => state.groupState); const { user } = useSelector(state => state.authState, shallowEqual); - const [isClick, setIsClick] = useState(0); + const [isClick, setIsClick] = useState(-1); const [dateType, setDateType] = useState(1); const [modal, setModal] = useState({