var getDate= new Date(); const now = new Date(1991,0,1);//默认 //计算最大最小时间范围 var min_y=((getDate.getFullYear()-45)) var max_y=((getDate.getFullYear()-18)) const minDate = new Date(min_y, 0, 1, 0, 0, 0) const maxDate = new Date(max_y, 11, 1, 0, 0, 0) constructor(props, context) { super(props, context); this.state = { birthday:now, } } <DatePicker mode="date" title="出生日期" extra="请选择" value={this.state.birthday} onChange={birthday =>{this.state.birthday2=birthday; this.state.birthday=birthday; this.forceUpdate(); console.log(birthday);}} minDate={minDate} maxDate={maxDate} > <List.Item arrow="horizontal" className={styles.Intr_input}>出生日期:</List.Item> </DatePicker>
关注"都市百货" 了解南陵
微信咨询wanglf2r(不拉群 发广告者勿加)
热门评论