DateTimePicker: Fixes DateTinePicker format is not taken into the picker itself #4931 (#5293)

* DatePicker: Fix Typing a date and tabbing does not close the calendar #4948

* DatePicker: Fix Typing a date and tabbing does not close the calendar #4948 -Updated test case

* Fixes #4931
pull/5899/merge
ChuckFields 2017-07-20 02:15:03 -04:00 committed by 杨奕
parent c73eeed291
commit be6cc78004
1 changed files with 10 additions and 2 deletions

View File

@ -406,11 +406,11 @@
visibleDate: {
get() {
return formatDate(this.date);
return formatDate(this.date, this.dateFormat);
},
set(val) {
const date = parseDate(val, 'yyyy-MM-dd');
const date = parseDate(val, this.dateFormat);
if (!date) {
return;
}
@ -445,6 +445,14 @@
} else {
return 'HH:mm:ss';
}
},
dateFormat() {
if (this.format) {
return this.format.replace('HH:mm', '').replace(':ss', '').trim();
} else {
return 'yyyy-MM-dd';
}
}
}
};