From 92d5522c3759862b4225f5a8bd6bc5e3d7951aac Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Fri, 13 Jan 2017 13:43:46 +0800 Subject: [PATCH] DatePicker: fix null value shows 1970, fixed #2388 --- packages/date-picker/src/util/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/date-picker/src/util/index.js b/packages/date-picker/src/util/index.js index abaa640ad..3d13a48e8 100644 --- a/packages/date-picker/src/util/index.js +++ b/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; };