From 6e44d421147004c4890245677868960396cba372 Mon Sep 17 00:00:00 2001 From: yiminghe Date: Wed, 1 Jul 2015 18:45:59 +0800 Subject: [PATCH] allow empty --- components/datepicker/index.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/datepicker/index.jsx b/components/datepicker/index.jsx index 4f5417371b..fd6c01b196 100644 --- a/components/datepicker/index.jsx +++ b/components/datepicker/index.jsx @@ -21,11 +21,10 @@ defaultCalendarValue.setTime(Date.now()); export default React.createClass({ getInitialState: function () { - var value = new GregorianCalendar(zhCn); + var value; if (this.props.value) { + value = new GregorianCalendar(zhCn); value.setTime(new Date(this.props.value).valueOf()); - } else { - value.setTime(Date.now()); } return { value: value