Commit 46650289 authored by xingoxu's avatar xingoxu Committed by 杨奕

DatePicker: fix date not disabled when type=datetime and input by text

parent fff57cdf
...@@ -407,14 +407,18 @@ ...@@ -407,14 +407,18 @@
set(val) { set(val) {
const date = parseDate(val, 'yyyy-MM-dd'); const date = parseDate(val, 'yyyy-MM-dd');
if (date) { if (!date) {
return;
}
if (typeof this.disabledDate === 'function' && this.disabledDate(date)) {
return;
}
date.setHours(this.date.getHours()); date.setHours(this.date.getHours());
date.setMinutes(this.date.getMinutes()); date.setMinutes(this.date.getMinutes());
date.setSeconds(this.date.getSeconds()); date.setSeconds(this.date.getSeconds());
this.date = date; this.date = date;
this.resetView(); this.resetView();
} }
}
}, },
yearLabel() { yearLabel() {
......
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