修复bug

This commit is contained in:
wangsongsole 2022-08-19 15:05:40 +08:00
parent b487a569cf
commit b825fa2ed9
1 changed files with 12 additions and 4 deletions

View File

@ -305,11 +305,19 @@ export default class addKnockGold extends Component {
onDisabledRange2 = (date, type) => {
let isdisabled = false
let str = moment(date).format('YYYY-MM-DD HH:mm:ss')
console.log(str, moment(str).isAfter(this.state.model.entry_time[1]))
const isDay = moment(this.state.model.entry_time[1]).format('HH:mm:ss')
if (type == 'start') {
isdisabled =
moment(str).isBefore(this.state.model.entry_time[0]) ||
moment(str).subtract(1, 'days').isAfter(this.state.model.entry_time[1])
if (isDay < '23:59:59') {
isdisabled =
moment(str).isBefore(this.state.model.entry_time[0]) ||
moment(str)
.subtract(1, 'days')
.isAfter(this.state.model.entry_time[1])
} else {
isdisabled =
moment(str).isBefore(this.state.model.entry_time[0]) ||
moment(str).isAfter(this.state.model.entry_time[1])
}
}
if (type == 'end') {