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
https://github.com/Pasoul/vant-bug 或者在手机上打开此链接:http://js.jirengu.com/befohevihi
2.12.54
DateTimePicker组件设置type为date,并且指定minDate为2023/05/17,滑动月份至6月,再滑动月份至5月快速点击确定,选中的日期是05/01,指定的minDate无效,这是我复现视频
感觉像是异步更新this.innerValue导致的问题
看了下DatePicker.js的formatValue方法:
formatValue(value) { if (!isDate(value)) { return null; } let minDate = new Date(this.minDate); let maxDate = new Date(this.maxDate); if (this.originColumns) { const dates = Object.keys(dateMethods) .map( (type) => dateColumns.filter((item) => item.type === type)[0]?.values ) .filter((item) => item); // 没有深入研究,不明白为什么要修改minDate和maxDate的值 minDate = new Date(...dates.map((val) => getTrueValue(val[0]))); maxDate = new Date(...dates.map((val) => getTrueValue(val[1]))); } // 如果拿value和this.minDate和this.maxDate原始值比,最终透传出去的值肯定不会比minDate小吧,只是个人猜测 value = Math.max(value, minDate.getTime()); value = Math.min(value, maxDate.getTime()); return new Date(value); },
No response
The text was updated successfully, but these errors were encountered:
vant/packages/vant/src/picker/Picker.tsx
Line 191 in e98e514
Sorry, something went wrong.
No branches or pull requests
重现链接
https://github.com/Pasoul/vant-bug
或者在手机上打开此链接:http://js.jirengu.com/befohevihi
Vant 版本
2.12.54
描述一下你遇到的问题。
DateTimePicker组件设置type为date,并且指定minDate为2023/05/17,滑动月份至6月,再滑动月份至5月快速点击确定,选中的日期是05/01,指定的minDate无效,这是我复现视频
normal.video.mp4
重现步骤
感觉像是异步更新this.innerValue导致的问题
看了下DatePicker.js的formatValue方法:
设备/浏览器
No response
The text was updated successfully, but these errors were encountered: