You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
以上2个按钮
《案例1》是正常的,最小可选日期是2018-08-12,因为11:00:00时间上小于12:00:00;
《案例2》同样的配置,只是值不同,它的最小可选日期就变成2018-08-11了,因为15:00:00时间上大于12:00:00;
问题应该是出在Datetime.js的renderDays方法不应该拿current的时间去比较min值,当尝试把hour、minute、second全部用0时,又出现了value是min当天时,时间选择可能会比min时间小的情况。
=====Datetime.js=====
let hour = current.getHours()
let minute = current.getMinutes()
let second = current.getSeconds()
......
for (let date, i = 0; i < end; i++) {
date = new Date(year, month, i + first, hour, minute, second)
days.push(date)
}
......
if (min > 0) {
disabled = speedTime + 86399000 < min
}
The text was updated successfully, but these errors were encountered:
案例1(正常,最小可选日期是2018-08-12):
<Datepicker type="datetime"
min={"2018-08-12 12:00:00"}
value={"2018-08-10 11:00:00"}
/>
案例2(异常,最小可选日期是2018-08-11):
<Datepicker type="datetime"
min={"2018-08-10 12:00:00"}
value={"2018-08-15 15:00:00"}
/>
以上2个按钮
《案例1》是正常的,最小可选日期是2018-08-12,因为11:00:00时间上小于12:00:00;
《案例2》同样的配置,只是值不同,它的最小可选日期就变成2018-08-11了,因为15:00:00时间上大于12:00:00;
问题应该是出在Datetime.js的renderDays方法不应该拿current的时间去比较min值,当尝试把hour、minute、second全部用0时,又出现了value是min当天时,时间选择可能会比min时间小的情况。
=====Datetime.js=====
let hour = current.getHours()
let minute = current.getMinutes()
let second = current.getSeconds()
......
for (let date, i = 0; i < end; i++) {
date = new Date(year, month, i + first, hour, minute, second)
days.push(date)
}
......
if (min > 0) {
disabled = speedTime + 86399000 < min
}
The text was updated successfully, but these errors were encountered: