moment.js:93 Uncaught TypeError: date.clone is not a function

moment.js:93 Uncaught TypeError: date.clone is not a function_第1张图片
原因:把数据向表单中保存,出现日期问题,处理数据中的时间

    //查看方法
    recorder.orderDate = moment(recorder.orderDate)
    recorder.planStartTime = moment(recorder.planStartTime)
    recorder.planFinishTime = moment(recorder.planFinishTime)
     this.setState({
      pId: recorder.id,
      editVisible: true,
      judgeViewFlag: true,
      title: "查看",
      viewData:recorder
    })
  }

将viewData放到Form的初始化值中

 <Form
          ref={this.editFormRef}
          initialValues={this.state.viewData}
          {...layout}>

你可能感兴趣的:(React)