From c90d03a409c1b5a3f86fc4adaad4315e3e367932 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Fri, 11 Aug 2023 17:19:11 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20=E5=8D=A1?= =?UTF-8?q?=E5=AF=86=E5=95=86=E5=93=81=E6=9C=89=E6=95=88=E6=9C=9F=E4=B8=8D?= =?UTF-8?q?=E5=81=9A=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseProductPop/index.jsx | 56 +++++++++++++------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/components/UseProductPop/index.jsx b/src/components/UseProductPop/index.jsx index b1062001..52e75a85 100644 --- a/src/components/UseProductPop/index.jsx +++ b/src/components/UseProductPop/index.jsx @@ -417,33 +417,33 @@ const UseProductPop = forwardRef((props, ref) => { } } - const onDisabledTime = (date) => { - let step1 = JSON.parse(sessionStorage.getItem("knockGold_effectDate")) - const min = new Date(step1.begin_time) - const hour = min.getHours() - const minute = min.getMinutes() - const second = min.getSeconds() - const isSame = isSameDay(date, min) + // const onDisabledTime = (date) => { + // let step1 = JSON.parse(sessionStorage.getItem("knockGold_effectDate")) + // const min = new Date(step1.begin_time) + // const hour = min.getHours() + // const minute = min.getMinutes() + // const second = min.getSeconds() + // const isSame = isSameDay(date, min) - return isSame - ? { - disabledHours: () => initArray(hour), - disabledMinutes: (hourValue) => (hourValue === hour ? initArray(minute) : []), - disabledSeconds: (hourValue, minuteValue) => - hourValue === hour && minuteValue === minute ? initArray(second) : [] - } - : {} - } - const onDisabledRange = (date, type) => { - let step1 = JSON.parse(sessionStorage.getItem("knockGold_effectDate")) - let disabled = false - if (step1) { - let str = moment(date).format("YYYY-MM-DD HH:mm:ss") - disabled = - moment(str).add(1, "days").isBefore(step1.begin_time) || moment(str).isAfter(step1.end_time) - } - return disabled - } + // return isSame + // ? { + // disabledHours: () => initArray(hour), + // disabledMinutes: (hourValue) => (hourValue === hour ? initArray(minute) : []), + // disabledSeconds: (hourValue, minuteValue) => + // hourValue === hour && minuteValue === minute ? initArray(second) : [] + // } + // : {} + // } + // const onDisabledRange = (date, type) => { + // let step1 = JSON.parse(sessionStorage.getItem("knockGold_effectDate")) + // let disabled = false + // if (step1) { + // let str = moment(date).format("YYYY-MM-DD HH:mm:ss") + // disabled = + // moment(str).add(1, "days").isBefore(step1.begin_time) || moment(str).isAfter(step1.end_time) + // } + // return disabled + // } const onUploadChangeGoods = (files, type) => { // 新增 @@ -533,8 +533,8 @@ const UseProductPop = forwardRef((props, ref) => { end_time: val }) }} - disabledTime={onDisabledTime} - disabledDate={onDisabledRange} + // disabledTime={onDisabledTime} + // disabledDate={onDisabledRange} /> ) : null}