♻️ refactor: 卡密商品有效期不做限制
This commit is contained in:
parent
f555d81c8f
commit
c90d03a409
|
@ -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}
|
||||
/>
|
||||
</FormItem>
|
||||
) : null}
|
||||
|
|
Loading…
Reference in New Issue