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