diff --git a/components/datepicker/demo/basic.md b/components/datepicker/demo/basic.md index 068b24431d..b2d724cc6f 100644 --- a/components/datepicker/demo/basic.md +++ b/components/datepicker/demo/basic.md @@ -11,6 +11,6 @@ var Datepicker = antd.Datepicker; React.render( - + , document.getElementById('components-datepicker-demo-basic')); ```` diff --git a/components/datepicker/index.jsx b/components/datepicker/index.jsx index 49368b09fe..ee7dd02752 100644 --- a/components/datepicker/index.jsx +++ b/components/datepicker/index.jsx @@ -15,7 +15,6 @@ Locale.shortMonths = ['1月', '2月', '3月', '4月', '5月', '6月', let defaultCalendarValue = new GregorianCalendar(zhCn); defaultCalendarValue.setTime(Date.now()); - function createPicker(TheCalendar) { return React.createClass({ getInitialState() { @@ -73,6 +72,11 @@ function createPicker(TheCalendar) { } else if (this.props.size === 'small') { sizeClass = ' ant-input-sm'; } + let defaultValue; + if (this.props.defaultValue) { + defaultValue = new GregorianCalendar(zhCn); + defaultValue.setTime(new Date(this.props.defaultValue).valueOf()); + } return ( diff --git a/components/modal/demo/info.md b/components/modal/demo/info.md index 81aa1f6610..e0b5e70d84 100644 --- a/components/modal/demo/info.md +++ b/components/modal/demo/info.md @@ -16,11 +16,6 @@ function info() { content: '一些附加信息一些附加信息一些附加信息', onOk: function() {} }); - Modal.info({ - title: '这是一条通知信息', - content: '一些附加信息一些附加信息一些附加信息', - onOk: function() {} - }); } function success() {