bee-datepicker
DatePicker ui component for react
Last updated 6 days ago by tinper-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install bee-datepicker 
SYNC missed versions from official npm registry.

datepicker

npm version Build Status Coverage Status dependencies Status NPM downloads Average time to resolve an issue Percentage of issues still open

react datepicker component for tinper-bee

可定制的日期组件

使用

使用单独的datepicker包

组件引入

先进行下载bee-datepicker包

npm install --save bee-datepicker

组件调用

import DatePicker from 'bee-datepicker';
ReactDOM.render(
        <DatePicker></DatePicker>
        , document.getElementById('target'));

样式引入

  • 可以使用link引入build目录下DatePicker.css
<link rel="stylesheet" href="./node_modules/bee-datepicker/build/DatePicker.css">
  • 可以在js中import样式
import "./node_modules/bee-datepicker/src/DatePicker.scss"
//或是
import "./node_modules/bee-datepicker/build/DatePicker.css"

API

DatePicker

参数 说明 类型 默认值
prefixCls 组件的前缀 String -
className 添加节点的样式 String -
dropdownClassName 添加下拉面板的样式 String -
style 添加内联样式 Object -
dateRender 日期表格 (current, value) => React.Node -
renderSidebar 侧边栏 () => React.Node -
renderFooter 扩展底边栏 () => React.Node -
defaultValue 默认值,输入框的默认值 moment -
value 日期 moment -
locale 日历的语言 Object en_US
format 日期格式化 String -
open 日期组件隐藏、显示 Boolean false
disabled 是否禁用功能 Boolean false
disabledDate 禁用的日期 Function(current:moment):Boolean -
disabledTime 禁用的时间 Function(current:moment):Object -
showDateInput 显示日期输入框 Boolean true
showWeekNumber 是否显示周数 Boolean false
showToday 是否显示今天 Boolean true
showOk 底边栏是否显示ok按钮 Boolean auto
onSelect 选择日期的回调函数 Function(date: moment) -
onChange 日期改变的回调函数 Function(date: moment) -
onOk 点击确定按钮的回调 Function(date: moment) -
dateInputPlaceholder 日期的placeholder String -
showTime 是否显示时间选择面板 Boolean -
renderIcon 更改默认的图标 Function () => <Icon type="uf-calendar" />
closeIcon 鼠标划过清空内容的icon Function () => <Icon type="uf-close-c" />
getCalendarContainer 更改默认渲染位置 Function -
keyboardInput 外层输入框是否支持键盘输入 Boolean false
iconClick 日期按钮点击的回调 Function -
outInputFocus 外层输入框获得焦点的回调 Function -
outInputKeydown 外层输入框keydown回调 Function -

注:使用keyboardInput时,以下api变化

  • 输入内容的格式需要个format格式相同,也可以有部分变化,变化范围参考 moment.js。例如:format='YYYY-MM-DD' 输入 '19-1-1'也可识别
  • 当输入日期格式无法转换为 moment 对象时,onChange,onClick回调内对应的moment参数值为 null

MonthPicker

参数 说明 类型 默认值
prefixCls 组件的前缀 String -
className 添加节点的样式 String -
style 添加内联样式 Object -
value 当前值,如输入框的值 moment -
defaultValue 默认值,输入框的默认值 moment -
locale 语言 Object en_US
disabledDate 禁用的日期 Function(current:moment):Boolean -
onSelect 选择日期的回调函数 Function(date: moment) -
onChange 日期改变的回调函数 Function(date: moment) -
monthCellRender 月份的渲染方法 function -
dateCellRender 日期的渲染方法 function -
monthCellContentRender 自定义月份的渲染方法,将被添加渲染内容中 function -
getCalendarContainer 更改默认渲染位置 Function -
closeIcon 鼠标划过清空内容的icon Function () => <Icon type="uf-close-c" />

RangePicker

参数 说明 类型 默认值
prefixCls 组件的前缀 String -
className 添加节点的样式 String -
style 添加内联样式 Object -
dateRender 日期表格 (current, value) => React.Node -
renderSidebar 侧边栏 () => React.Node -
renderFooter 扩展底边栏 () => React.Node -
value 当前选中的区间 moment[] -
defaultValue 默认选中的区间 moment[] -
locale 日历的语言 Object en_US
format 日期格式化 String -
disabledDate 禁用的日期 Function(current:moment):Boolean -
disabledTime 禁用的时间 Function(current:moment):Object -
showDateInput 显示日期输入康 Boolean true
showWeekNumber 是否显示周数 Boolean false
showToday 是否显示今天 Boolean true
showOk 底边栏是否显示ok按钮 Boolean auto
showClear 是否显示清除按钮 Boolean false
onSelect 选择日期的回调函数 Function(date: moment) -
onChange 日期改变的回调函数 Function(date: moment) -
dateInputPlaceholder 日期的placeholder String -
type 是否固定开始或结束选定的值 enum('both','start', 'end') -
getCalendarContainer 更改默认渲染位置 Function -
closeIcon 鼠标划过清空内容的icon Function () => <Icon type="uf-close-c" />

WeekPicker

参数 说明 类型 默认值
placeholder 输入框placeholder String -
defaultValue 默认值 moment -
getCalendarContainer 更改默认渲染位置 Function -
closeIcon 鼠标划过清空内容的icon Function () => <Icon type="uf-close-c" />

YearPicker

参数 说明 类型 默认值
placeholder 输入框placeholder String -
defaultValue 默认值 moment 当前年
getCalendarContainer 更改默认渲染位置 Function -
format 日期格式化 String -
disabled 是否禁用功能 Boolean false
closeIcon 鼠标划过清空内容的icon Function () => <Icon type="uf-close-c" />

DatePicker 已支持的键盘操作

按键 功能
↓(下箭) 打开面板
esc 关闭面板
delete 清除内容

setup develop environment

$ npm install -g bee-tools
$ git clone https://github.com/tinper-bee/bee-datepicker.git
$ cd bee-datepicker
$ npm install
$ npm run dev

Current Tags

  • 2.3.37-alpha.2                                ...           alpha (15 days ago)
  • 2.2.7-beta.0                                ...           beta (a year ago)
  • 2.3.45                                ...           latest (6 days ago)
  • 3.0.0-mdf.2                                ...           mdf (a year ago)
  • 2.3.12-nc.3                                ...           ncc (a month ago)
  • 2.3.40-yonui.1                                ...           yonui (15 days ago)

238 Versions

  • 2.3.45                                ...           6 days ago
  • 2.3.44                                ...           6 days ago
  • 2.3.43                                ...           13 days ago
  • 2.3.41                                ...           13 days ago
  • 2.3.40                                ...           14 days ago
  • 2.3.40-yonui.1                                ...           15 days ago
  • 2.3.40-yonui.0                                ...           15 days ago
  • 2.3.37-alpha.2                                ...           15 days ago
  • 2.3.12-nc.3                                ...           a month ago
  • 2.3.39                                ...           a month ago
  • 2.3.38                                ...           a month ago
  • 2.3.37-alpha.1                                ...           a month ago
  • 2.3.37                                ...           a month ago
  • 2.3.37-alpha.0                                ...           a month ago
  • 2.3.12-nc.2                                ...           a month ago
  • 2.3.12-nc.1                                ...           2 months ago
  • 2.3.12-nc                                ...           2 months ago
  • 2.3.36                                ...           2 months ago
  • 2.3.32                                ...           2 months ago
  • 2.3.33                                ...           2 months ago
  • 2.3.34                                ...           2 months ago
  • 2.3.30                                ...           2 months ago
  • 2.3.29                                ...           2 months ago
  • 2.3.28                                ...           2 months ago
  • 2.3.27                                ...           3 months ago
  • 2.3.26                                ...           3 months ago
  • 2.3.25                                ...           3 months ago
  • 2.3.24                                ...           5 months ago
  • 2.3.23                                ...           6 months ago
  • 2.3.22                                ...           6 months ago
  • 2.3.21                                ...           6 months ago
  • 2.3.21-alpha.0                                ...           6 months ago
  • 2.3.20                                ...           6 months ago
  • 2.3.19                                ...           6 months ago
  • 2.3.18                                ...           7 months ago
  • 2.3.17                                ...           7 months ago
  • 2.3.17-alpha.2                                ...           7 months ago
  • 2.3.17-alpha.1                                ...           7 months ago
  • 2.3.17-alpha.0                                ...           7 months ago
  • 2.3.16                                ...           7 months ago
  • 2.3.15                                ...           7 months ago
  • 2.3.14                                ...           8 months ago
  • 2.3.13                                ...           8 months ago
  • 2.3.13-alpha.0                                ...           8 months ago
  • 2.3.12                                ...           10 months ago
  • 2.3.11                                ...           10 months ago
  • 2.3.10                                ...           10 months ago
  • 2.3.9                                ...           10 months ago
  • 2.3.8                                ...           10 months ago
  • 2.3.7                                ...           10 months ago
  • 2.3.5                                ...           a year ago
  • 2.3.4                                ...           a year ago
  • 2.3.3                                ...           a year ago
  • 2.3.2                                ...           a year ago
  • 2.3.1                                ...           a year ago
  • 2.3.0                                ...           a year ago
  • 2.2.19                                ...           a year ago
  • 2.2.18                                ...           a year ago
  • 2.2.17                                ...           a year ago
  • 2.2.16                                ...           a year ago
  • 2.2.15                                ...           a year ago
  • 2.2.14                                ...           a year ago
  • 2.2.13                                ...           a year ago
  • 2.2.12                                ...           a year ago
  • 2.2.11                                ...           a year ago
  • 2.2.11-alpha.0                                ...           a year ago
  • 2.2.10                                ...           a year ago
  • 2.2.9                                ...           a year ago
  • 3.0.0-mdf.2                                ...           a year ago
  • 2.2.8                                ...           a year ago
  • 2.2.8-alpha.1                                ...           a year ago
  • 2.2.8-alpha.0                                ...           a year ago
  • 3.0.0-mdf.1                                ...           a year ago
  • 3.0.0-mdf.0                                ...           a year ago
  • 2.3.0-alpha.0                                ...           a year ago
  • 2.2.7                                ...           a year ago
  • 2.2.7-beta.0                                ...           a year ago
  • 2.2.6                                ...           a year ago
  • 2.2.6-alpha.0                                ...           a year ago
  • 2.2.5                                ...           a year ago
  • 2.2.4                                ...           a year ago
  • 2.2.4-alhpa.0                                ...           a year ago
  • 2.2.3                                ...           a year ago
  • 2.2.3-beta.3                                ...           a year ago
  • 2.2.3-beta.2                                ...           a year ago
  • 2.2.3-beta.1                                ...           a year ago
  • 2.2.3-beta.0                                ...           a year ago
  • 2.2.2                                ...           a year ago
  • 2.2.1                                ...           a year ago
  • 2.2.0                                ...           a year ago
  • 2.2.0-beta.2                                ...           a year ago
  • 2.2.0-beta.1                                ...           a year ago
  • 2.2.0-beta.0                                ...           a year ago
  • 2.1.2                                ...           a year ago
  • 2.1.2-beta.1                                ...           a year ago
  • 2.1.2-beta.0                                ...           a year ago
  • 2.1.1                                ...           a year ago
  • 2.1.1-alpha.1                                ...           a year ago
  • 2.1.1-alpha.0                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.47-alpha.1                                ...           a year ago
  • 2.0.47-alpha.0                                ...           a year ago
  • 2.0.46                                ...           a year ago
  • 2.0.45                                ...           a year ago
  • 2.0.44                                ...           a year ago
  • 2.0.43                                ...           a year ago
  • 2.0.42                                ...           a year ago
  • 2.0.41                                ...           a year ago
  • 2.0.40                                ...           a year ago
  • 2.0.39                                ...           a year ago
  • 2.0.38                                ...           a year ago
  • 2.0.37                                ...           a year ago
  • 2.0.36                                ...           a year ago
  • 2.0.35                                ...           a year ago
  • 2.0.34                                ...           a year ago
  • 2.0.33                                ...           a year ago
  • 2.0.32                                ...           a year ago
  • 2.0.31                                ...           a year ago
  • 2.0.30                                ...           a year ago
  • 2.0.29                                ...           2 years ago
  • 2.0.28                                ...           2 years ago
  • 2.0.26                                ...           2 years ago
  • 2.0.25                                ...           2 years ago
  • 2.0.24                                ...           2 years ago
  • 2.0.23                                ...           2 years ago
  • 2.0.22                                ...           2 years ago
  • 2.0.21                                ...           2 years ago
  • 2.0.20                                ...           2 years ago
  • 2.0.19                                ...           2 years ago
  • 2.0.18                                ...           2 years ago
  • 2.0.17                                ...           2 years ago
  • 2.0.16                                ...           2 years ago
  • 1.3.22                                ...           2 years ago
  • 2.0.13                                ...           2 years ago
  • 2.0.12                                ...           2 years ago
  • 2.0.11                                ...           2 years ago
  • 2.0.10                                ...           2 years ago
  • 2.0.9                                ...           2 years ago
  • 2.0.8                                ...           2 years ago
  • 1.3.21                                ...           2 years ago
  • 2.0.7                                ...           2 years ago
  • 2.0.6                                ...           2 years ago
  • 2.0.5                                ...           2 years ago
  • 1.3.20                                ...           2 years ago
  • 2.0.4                                ...           2 years ago
  • 1.3.18                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 1.3.17                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 1.3.15                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 2.0.0-beta3                                ...           2 years ago
  • 2.0.0-beta2                                ...           2 years ago
  • 2.0.0-beta1                                ...           2 years ago
  • 2.0.0-beta                                ...           2 years ago
  • 2.0.0-alpha.1                                ...           2 years ago
  • 2.0.0-alpha.0                                ...           2 years ago
  • 1.3.14                                ...           2 years ago
  • 1.3.13                                ...           2 years ago
  • 1.3.12                                ...           2 years ago
  • 1.3.11                                ...           2 years ago
  • 1.3.10                                ...           2 years ago
  • 1.3.10-beta                                ...           2 years ago
  • 1.3.9                                ...           2 years ago
  • 1.3.8                                ...           2 years ago
  • 1.3.7                                ...           2 years ago
  • 1.3.6                                ...           2 years ago
  • 1.3.5                                ...           2 years ago
  • 1.3.4                                ...           2 years ago
  • 1.3.3                                ...           2 years ago
  • 1.3.2                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.9                                ...           2 years ago
  • 1.2.8                                ...           2 years ago
  • 1.2.7                                ...           2 years ago
  • 1.2.6                                ...           2 years ago
  • 1.2.5                                ...           2 years ago
  • 1.2.4                                ...           2 years ago
  • 1.2.3                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.9                                ...           2 years ago
  • 1.1.8                                ...           2 years ago
  • 1.1.7                                ...           2 years ago
  • 1.1.6                                ...           2 years ago
  • 1.1.5                                ...           2 years ago
  • 1.1.4                                ...           2 years ago
  • 1.1.3                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.35                                ...           2 years ago
  • 1.0.33                                ...           2 years ago
  • 1.0.32                                ...           2 years ago
  • 1.0.31                                ...           2 years ago
  • 1.0.30                                ...           2 years ago
  • 1.0.29                                ...           2 years ago
  • 1.0.28                                ...           2 years ago
  • 1.0.27                                ...           2 years ago
  • 1.0.26                                ...           2 years ago
  • 1.0.25                                ...           2 years ago
  • 1.0.24                                ...           2 years ago
  • 1.0.23                                ...           2 years ago
  • 1.0.22                                ...           2 years ago
  • 1.0.21                                ...           2 years ago
  • 1.0.20                                ...           2 years ago
  • 1.0.19                                ...           2 years ago
  • 1.0.18                                ...           3 years ago
  • 1.0.17                                ...           3 years ago
  • 1.0.16                                ...           3 years ago
  • 1.0.15                                ...           3 years ago
  • 1.0.14                                ...           3 years ago
  • 1.0.13                                ...           3 years ago
  • 1.0.12                                ...           3 years ago
  • 1.0.11                                ...           3 years ago
  • 1.0.10                                ...           3 years ago
  • 1.0.9                                ...           3 years ago
  • 1.0.8                                ...           3 years ago
  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.1.8                                ...           3 years ago
  • 0.1.7                                ...           3 years ago
  • 0.1.6                                ...           3 years ago
  • 0.1.5                                ...           3 years ago
  • 0.1.4                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago

Copyright 2014 - 2016 © taobao.org |