Commit be6cc780 authored by ChuckFields's avatar ChuckFields Committed by 杨奕

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