소스 검색

DatetimePicker: fix max time error when init value is empty (#8336)

1.no init data
2.click start time and comfirm
3.click end time and comfirm(the end time is not change)
4.error
reason:
not evaluate 'maxDate' value in step1
I will show more details in conversation
Leslie 7 년 전
부모
커밋
55617e0d1a
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      packages/date-picker/src/panel/date-range.vue

+ 1 - 1
packages/date-picker/src/panel/date-range.vue

@@ -508,7 +508,7 @@
           this.minTimePickerVisible = visible;
         }
 
-        if (this.maxDate && this.maxDate.getTime() < this.minDate.getTime()) {
+        if (!this.maxDate || this.maxDate && this.maxDate.getTime() < this.minDate.getTime()) {
           this.maxDate = new Date(this.minDate);
         }
       },