DatePicker: update view when setting default value, fixed #1050 (#1097)

pull/1100/head
cinwell.li 2016-11-16 14:48:15 +08:00 committed by 杨奕
parent d54bf670a2
commit af4bca8abe
2 changed files with 3 additions and 3 deletions

View File

@ -145,8 +145,8 @@
},
value(newVal) {
if (newVal instanceof Date) {
newVal = new Date(newVal);
if (!isNaN(newVal)) {
if (typeof this.disabledDate === 'function' &&
this.disabledDate(new Date(newVal))) {
return;

View File

@ -684,7 +684,7 @@ describe('DatePicker', () => {
vm.picker.value = date;
setTimeout(_ => {
expect(vm.picker.date === date).to.true;
expect(vm.picker.date.getTime() === date.getTime()).to.true;
done();
}, DELAY);
});