-
Notifications
You must be signed in to change notification settings - Fork 350
fix(time-picker): 验证输入的时间不为被禁止的 #2266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
closed #5939
js/time-picker/utils.ts
Outdated
| export function validateInputValue( | ||
| value: string, | ||
| format: string, | ||
| disableTime?: (...params: any) => any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
返回值不应该定义为any?
这个方法有具体的返回类型吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下面这种写法可以吗,可以的话我commit一下
export function validateInputValue(
value: string,
format: string,
disableTime?: (...params: any) => { [key in EPickerCols]?: number[]; } | null
) { ...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不对哦,直接复制过来吧😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,已修改
js/time-picker/utils.ts
Outdated
| s: number, | ||
| ms: number, | ||
| context: { partial: 'start' | 'end' }, | ||
| ) => Partial<{ hour: Array<number>; minute: Array<number>; second: Array<number> }> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数是timePicker和timeRangePicker共用的,所以需要考虑到毫秒的情况
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已加入

🤔 这个 PR 的性质是?
🔗 相关 Issue
fix #5939
💡 需求背景和解决方案
📝 更新日志
fix(time-picker): 在validateInputValue中加入对禁止时间的判定
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单