Commit 8912827e authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复结束时间可以小于当前时间的问题

parent 2d5d8e07
......@@ -40,7 +40,7 @@ const schema: ISchema = {
},
disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (current, type) => {
if (type === 'start' && moment().isSame(current, 'day')) {
if ((type === 'start' || type === 'end') && moment().isSame(current, 'day')) {
return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:05:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-15 14:20:08
* @LastEditTime: 2021-11-30 20:16:53
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -106,7 +106,7 @@ const schema: ISchema = {
showTime: true,
disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (current, type) => {
if (type === 'start' && moment().isSame(current, 'day')) {
if ((type === 'start' || type === 'end') && moment().isSame(current, 'day')) {
return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
......@@ -303,7 +303,7 @@ const schema: ISchema = {
showTime: true,
disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (current, type) => {
if (type === 'start' && moment().isSame(current, 'day')) {
if ((type === 'start' || type === 'end') && moment().isSame(current, 'day')) {
return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment