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

pull/4375/head
xingoxu 2017-04-19 15:11:58 +08:00 committed by 杨奕
parent fff57cdfcc
commit 46650289b7
1 changed files with 10 additions and 6 deletions

View File

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