我想把日期设置为另一天,然后将日期加1。
onModalPrevDate=()=>{
this.closeModal();
let d=this.state.selectedDay;
let dateContext = Object.assign({}, this.props.dateContext);
let c=moment(dateContext).set("days",d); //not working as intended
let f=moment(c).add(1,"day");
let a=f.format("D");
this.onDayClick(a);
}
moment(dateContext).set("days",d);没有按预期工作。尝试使用"day"代替"days"仍然不起作用。