Browse Source

update timepicker

pull/2177/head
bang 8 years ago
parent
commit
00710328b1
  1. 3
      components/index.tsx
  2. 34
      components/time-picker/index.tsx

3
components/index.tsx

@ -23,3 +23,6 @@ export { Tabs }
import Tag from './tag';
export { Tag }
import TimePicker from './time-picker';
export { TimePicker }

34
components/time-picker/index.tsx

@ -5,7 +5,35 @@ import defaultLocale from './locale/zh_CN';
import classNames from 'classnames';
import GregorianCalendar from 'gregorian-calendar';
import assign from 'object-assign';
export default class TimePicker extends React.Component {
// TimePicker
export interface TimePickerProps {
/** 默认时间*/
value?: string | Date,
/** 初始默认时间*/
defaultValue?: string | Date,
/** 展示的时间格式 : "HH:mm:ss"、"HH:mm"、"mm:ss" */
format?: string,
/** 时间发生变化的回调*/
onChange?: (Date: Date) => void,
/** 禁用全部操作*/
disabled?: boolean,
/** 没有值的时候显示的内容*/
placeholder?: string,
/** 国际化配置*/
locale?: Object,
/** 隐藏禁止选择的选项*/
hideDisabledOptions?: boolean,
/** 禁止选择部分小时选项*/
disabledHours?: Function,
/** 禁止选择部分分钟选项*/
disabledMinutes?: Function,
/** 禁止选择部分秒选项*/
disabledSeconds?: Function,
style?: React.CSSProperties
}
export default class TimePicker extends React.Component<TimePickerProps, any> {
static defaultProps = {
format: 'HH:mm:ss',
prefixCls: 'ant-time-picker',
@ -109,9 +137,9 @@ export default class TimePicker extends React.Component {
{...props}
className={className}
locale={locale}
formatter={this.getFormatter()}
formatter={this.getFormatter() }
onChange={this.handleChange}
/>
/>
);
}
}

Loading…
Cancel
Save