We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<DatepickerRange type="date" min={custom_min} max={custom_max} name="daterange" unixtime={true} value={[custom_start, custom_end]} onChange={this.changeDaterange} />
./utils/validation.js 验证逻辑有问题 这里 valueType === "string" switch (valueType) { case 'array': len = toArray(value, sep).length break case 'number': len = parseFloat(value) break default: len = value.length break }
if (max && len > max) { return handleError(label, max, max.${valueType}, tip) } 如果形如 min = "2018-06-28",则下面验证可以绕过, 如果 形如 min = 1527643386974,则下面验证会进入报错 整个验证逻辑好像没有兼容到 DatepickerRange[type="date"] 模式 if (min && len < min) { return handleError(label, min, min.${valueType}, tip) }
max.${valueType}
min.${valueType}
The text was updated successfully, but these errors were encountered:
DatepickerRange 的 validate 走不到这里,应该调用的是这个文件 https://github.com/Lobos/react-ui/blob/master/src/Datepicker/Range.js
function validate (value = [], args) { if (!args.required) return true let result = (value[0] && value[1]) ? true : new Error(format(getLang('validation.tips.required'), args.label || '')) return result } export default compose( FormItem.register(['datetime-range', 'date-range', 'time-range'], { valueType: 'datetime', validate }), PureRender() )(Range)
Sorry, something went wrong.
No branches or pull requests
<DatepickerRange type="date" min={custom_min} max={custom_max} name="daterange" unixtime={true} value={[custom_start, custom_end]} onChange={this.changeDaterange} />
./utils/validation.js 验证逻辑有问题
这里 valueType === "string"
switch (valueType) {
case 'array':
len = toArray(value, sep).length
break
case 'number':
len = parseFloat(value)
break
default:
len = value.length
break
}
if (max && len > max) {
return handleError(label, max,
max.${valueType}
, tip)}
如果形如 min = "2018-06-28",则下面验证可以绕过,
如果 形如 min = 1527643386974,则下面验证会进入报错
整个验证逻辑好像没有兼容到 DatepickerRange[type="date"] 模式
if (min && len < min) {
return handleError(label, min,
min.${valueType}
, tip)}
The text was updated successfully, but these errors were encountered: