From b3c6a31b55e65145f63095e92d26d9f1914213a5 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 8 Aug 2019 11:16:39 +0800 Subject: [PATCH] disabledDate={disabledDateFunc} --- .../src/modules/courses/busyWork/CommonWorkSetting.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js index 8baee4b45..aeda66ae1 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js @@ -42,6 +42,9 @@ function disabledDateTime() { // disabledSeconds: () => [55, 56], }; } +function disabledDateFunc(current) { + return current && current < moment().endOf('day').subtract(1, 'days'); +} // 类似页面 http://localhost:3007/courses/1309/graduation/graduation_tasks/48/76/setting class CommonWorkSetting extends Component{ @@ -1093,6 +1096,7 @@ class CommonWorkSetting extends Component{ onChange={this.onChangeTimeend} disabled={this.props.isSuperAdmin()?false:end_time_type===true?true:false} disabled={moment(this.state.init_end_time) < moment() || noAuth} + disabledDate={disabledDateFunc} // disabledDate={ (end_time) => // { @@ -1166,6 +1170,7 @@ class CommonWorkSetting extends Component{ disabledTime={disabledDateTime} // || moment(init_late_time) < moment() disabled={!allow_late || noAuth } + disabledDate={disabledDateFunc} // disabledDate={ (late_time) => // { // const end_time = this.state.end_time @@ -1247,6 +1252,8 @@ class CommonWorkSetting extends Component{ onChange={this.onChangeEvaluationEnd} disabledTime={disabledDateTime} disabled={(anonymous_comment && !noAuth ? false : true) || moment(init_evaluation_end) < moment()} + disabledDate={disabledDateFunc} + // disabledDate={ (evaluation_end) => // { // const evaluation_start = this.state.evaluation_start @@ -1335,6 +1342,7 @@ class CommonWorkSetting extends Component{ dropdownClassName="hideDisable" showTime={{ format: 'HH:mm' }} disabledTime={disabledDateTime} + disabledDate={disabledDateFunc} showToday={false} locale={locale} format={dateFormat}