From 19f62e161180a3dbbd87caa26fa9ca3cf03e6d5b Mon Sep 17 00:00:00 2001 From: bang Date: Thu, 13 Dec 2018 10:18:36 +0800 Subject: [PATCH] feat: support use12hours close #151 --- components/date-picker-view/demo/basic.tsx | 11 +++++++++-- components/date-picker-view/index.en-US.md | 3 ++- components/date-picker-view/index.zh-CN.md | 1 + components/date-picker/index.tsx | 4 ++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/components/date-picker-view/demo/basic.tsx b/components/date-picker-view/demo/basic.tsx index 3835626ff..d502020b0 100644 --- a/components/date-picker-view/demo/basic.tsx +++ b/components/date-picker-view/demo/basic.tsx @@ -6,17 +6,24 @@ import { DatePickerView } from '../../'; export default class DatePickerViewExample extends React.Component { state = { value: undefined, + value12hours: undefined, }; onChange = (value: any) => { console.log(value); this.setState({ value }); - } + }; onValueChange = (...args: any[]) => { console.log(args); - } + }; render() { return ( + use12Hours + this.setState({ value12hours: v })} + use12Hours + /> Start DateTime void | - | diff --git a/components/date-picker-view/index.zh-CN.md b/components/date-picker-view/index.zh-CN.md index c41846bdf..92a437ef1 100644 --- a/components/date-picker-view/index.zh-CN.md +++ b/components/date-picker-view/index.zh-CN.md @@ -18,5 +18,6 @@ DatePickerView 的功能类似于 DatePicker ,但它是直接渲染在区域 | minuteStep | 分钟数递增步长设置 | Number | 1 | | locale | 国际化,可覆盖全局`[LocaleProvider](https://mobile.ant.design/components/locale-provider)`的配置 | Object: {DatePickerLocale: {year, month, day, hour, minute, am?, pm?}, okText, dismissText } | - | | disabled | 是否不可用 | Boolean | false | +| use12Hours | 12小时制 | Boolean | false | | onChange | 时间发生变化的回调函数 | (date: Object): void | - | | onValueChange | 每列 picker 改变时的回调 | (vals: any, index: number) => void | - | diff --git a/components/date-picker/index.tsx b/components/date-picker/index.tsx index 18c45258b..8465b19a4 100644 --- a/components/date-picker/index.tsx +++ b/components/date-picker/index.tsx @@ -4,7 +4,7 @@ import React from 'react'; import PickerStyles, { PickerStyle } from '../picker/style/index'; import { WithTheme, WithThemeStyles } from '../style'; import { getComponentLocale } from '../_util/getLocale'; -import RCDatePicker from './datepicker'; +import AntDatePicker from './datepicker'; import PopupDatePicker from './datepicker/Popup'; import { DatePickerPropsType } from './PropsType'; import { formatProps } from './utils'; @@ -36,7 +36,7 @@ export default class DatePicker extends React.Component { const { okText, dismissText, extra, DatePickerLocale } = locale; const dataPicker = ( -