Commit 968f7cc3 authored by XieZhiXiong's avatar XieZhiXiong

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

parent 3833bfeb
...@@ -40,7 +40,7 @@ const schema: ISchema = { ...@@ -40,7 +40,7 @@ const schema: ISchema = {
}, },
disabledDate: (current) => current && current < moment().startOf('day'), disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (current, type) => { disabledTime: (current, type) => {
if (type === 'start' && moment().isSame(current, 'day')) { if ((type === 'start' || type || 'end') && moment().isSame(current, 'day')) {
return { return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')), disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')), disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-06-24 14:05:57 * @Date: 2021-06-24 14:05:57
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-15 14:22:39 * @LastEditTime: 2021-11-30 20:14:44
* @Description: * @Description:
*/ */
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
...@@ -106,7 +106,7 @@ const schema: ISchema = { ...@@ -106,7 +106,7 @@ const schema: ISchema = {
showTime: true, showTime: true,
disabledDate: (current) => current && current < moment().startOf('day'), disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (current, type) => { disabledTime: (current, type) => {
if (type === 'start' && moment().isSame(current, 'day')) { if ((type === 'start' || type || 'end') && moment().isSame(current, 'day')) {
return { return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')), disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')), disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
...@@ -303,7 +303,7 @@ const schema: ISchema = { ...@@ -303,7 +303,7 @@ const schema: ISchema = {
showTime: true, showTime: true,
disabledDate: (current) => current && current < moment().startOf('day'), disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (current, type) => { disabledTime: (current, type) => {
if (type === 'start' && moment().isSame(current, 'day')) { if ((type === 'start' || type || 'end') && moment().isSame(current, 'day')) {
return { return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')), disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')), 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