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

DatePicker: fix null value shows 1970, fixed #2388
pull/2395/head
baiyaaaaa 2017-01-13 14:57:44 +08:00 committed by GitHub
commit 9898ac49e1
1 changed files with 2 additions and 2 deletions

View File

@ -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;
};