소스 검색

Merge pull request #2390 from QingWei-Li/fix/datepicker/value

DatePicker: fix null value shows 1970, fixed #2388
baiyaaaaa 8 년 전
부모
커밋
9898ac49e1
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      packages/date-picker/src/util/index.js

+ 2 - 2
packages/date-picker/src/util/index.js

@@ -17,8 +17,8 @@ export const toDate = function(date) {
 };
 
 export const isDate = function(date) {
-  date = new Date(date);
-  if (isNaN(date.getTime())) return false;
+  if (date === null || date === undefined) return false;
+  if (isNaN(new Date(date).getTime())) return false;
   return true;
 };