From 20211d448c9af98a4bf3e27a480f9ffe9d177b11 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 23 Mar 2016 15:58:46 +0800 Subject: [PATCH] Add default width for showTime DatePicker --- components/date-picker/demo/time.md | 2 +- components/date-picker/index.jsx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/date-picker/demo/time.md b/components/date-picker/demo/time.md index 81de2d224c..e7de19c240 100644 --- a/components/date-picker/demo/time.md +++ b/components/date-picker/demo/time.md @@ -14,6 +14,6 @@ function onChange(value) { } ReactDOM.render( - + , mountNode); ```` diff --git a/components/date-picker/index.jsx b/components/date-picker/index.jsx index b6dd9fb69a..9c45da4898 100644 --- a/components/date-picker/index.jsx +++ b/components/date-picker/index.jsx @@ -114,8 +114,15 @@ function createPicker(TheCalendar, defaultFormat) { if (this.state.open) { pickerClass += ' ant-calendar-picker-open'; } + + // default width for showTime + const pickerStyle = {}; + if (this.props.showTime) { + pickerStyle.width = 180; + } + return ( - +