This commit is contained in:
姜棚 2021-11-24 19:05:15 +08:00
parent 931fa8de57
commit d1914b0092
3 changed files with 26 additions and 7 deletions

View File

@ -126,13 +126,9 @@ export default class acclist extends React.Component{
model:model2
});
}
onDisabledCombinedDate = (val)=>{
console.log(val.getTime())
console.log(new Date().getTime())
return val.getDate() < new Date();
onDisabledCombinedDate = (val)=>{
return val.getTime() < new Date().getTime();
}
render(){
//校验规则

View File

@ -12,6 +12,7 @@ import Addruleform from "./addruleform/addruleform"
import Productform from "../product/add"
import Bus from "../../../assets/eventBus.js"
import _ from "lodash";
import moment from "moment"
const TabPanel = Tabs.TabPanel;
export default class acclist extends React.Component{
@ -258,6 +259,22 @@ export default class acclist extends React.Component{
this.setState({distdata:this.state.distdata})
console.log(this.state.distdata)
}
onDisabledCombinedDate = (val)=>{
let step1 = JSON.parse (sessionStorage.getItem("step1"));
let str = moment(val).format("YYYY-MM-DD HH:mm:ss")
let isBetween = moment(str).isBetween(step1.begin_time,step1.end_time);
console.log(isBetween)
return isBetween
}
render(){
const Column = [
{
@ -591,6 +608,7 @@ export default class acclist extends React.Component{
format: 'HH:mm:ss',
defaultTime: ['12:00:00', '23:59:59'],
}}
disabledDate={this.onDisabledCombinedDate}
format="YYYY-MM-DD HH:mm:ss"
onChange={(e)=>{

View File

@ -54,6 +54,11 @@ export default class acclist extends React.Component{
// model2.style = e;
// this.setState({model:model2})
}
onDisabledCombinedDate = (val)=>{
return val.getTime() < new Date().getTime();
}
render(){
const Column = [
{