From 9ef14500f3abfcc7081f8dceab8187ec835e3918 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 14 Oct 2015 18:09:28 +0800 Subject: [PATCH 1/2] Fix datepicker defaultValue, closes #391 --- components/datepicker/demo/basic.md | 2 +- components/datepicker/index.jsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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 ( From ed7114e25eb148ccc033063dbf7072e8c6f7bb50 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 15 Oct 2015 11:26:07 +0800 Subject: [PATCH 2/2] update modal info --- components/modal/demo/info.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/components/modal/demo/info.md b/components/modal/demo/info.md index 1eedb5d511..f7a9fe62b0 100644 --- a/components/modal/demo/info.md +++ b/components/modal/demo/info.md @@ -15,11 +15,6 @@ function info() { content: '一些附加信息一些附加信息一些附加信息', onOk: function() {} }); - Modal.info({ - title: '这是一条通知信息', - content: '一些附加信息一些附加信息一些附加信息', - onOk: function() {} - }); } function success() {