1.0.4 • Published 7 years ago
first-time-picker v1.0.4
TimePicker
时间选择器 同antd不再做描述
MaxMinTimePicker
可设置最大值最小值
DefaultEnd
设置开始时间后 根据 课程时长 计算结束时间 DefaultEnd
Screenshots
设置开始时间后 根据 课程时长 计算结束时间

Install
npm i --save first-time-pickerUsage
import { MaxMinTimePicker, DefaultEnd } from 'first-time-picker';MaxMinTimePicker
<MaxMinTimePicker value={value}
placeholder="开始时间"
format='HH:mm'
onChange={(time,value)=>console.log(time,value)}
max="23:25:00"
/>DefaultEnd
<DefaultEnd
start_time={start_time}
course_leng={40}
onChange={(start_time,end_time)=>this.setState({start_time,end_time})} />API
props
MaxMinTimePicker
| name | type | default | description |
|---|---|---|---|
| value | string | - | 选择的时间 如10:00:00 |
| format | string | 'HH:mm' | 时间格式 |
| minuteStep | number | 5 | 分钟选项间隔 |
| placeholder | string | - | 没有值的时候显示的内容 |
| onChange | fun | - | change时的回调 返回(time: moment, timeString: string) |
| max | string | - | 最大可选时间 如'23:25:00' |
| min | string | - | 最大可选时间 如'06:25:00' |
| disabled | boolean | - | 是否不可用 |
| style | object | - | 样式 |
DefaultEnd
| name | type | default | description |
|---|---|---|---|
| start_time | string | - | 开始时间 如10:00:00 |
| course_leng | number | - | 课程时长 如40 |
| onChange | fun | - | change时的回调 返回(start_time, end_time) |
| style | object | - | 样式 |
| className | string | - | 样式 |