nativerepo.com

rmc-date-picker


React Mobile DatePicker Component (web and react-native)

NPM version react-native react build status Test coverage gemnasium deps node version npm download

Screenshots

web

ios

android

Usage

see example

config webpack to resolve .web.js

resolve: {
  extensions: ['', '.web.tsx', '.web.ts', '.web.jsx', '.web.js', '.ts', '.tsx', '.js', '.jsx', '.json'],
},

Development

npm i
npm start

Example

http://localhost:8000/examples/

online example: http://react-component.github.io/m-date-picker/

react-native

npm run watch-tsc
./node_modules/rc-tools run react-native-init
react-native run-ios

install

rmc-date-picker

API

DatePicker props

namedescriptiontypedefault
className(web)additional css class of root dom nodeString''
prefixCls(web)prefix classString'rmc-date-picker'
pickerPrefixCls(web)picker prefix classString'rmc-picker'
defaultDatedefault selected date.moment
dateThe currently selected date.moment
modeThe date picker mode.String'date' enum('date', 'time', 'datetime', 'year', 'month')
minDatemin datemoment2000-1-1
maxDatemax datemoment2030-1-1
localethe locale of areaObjectimport from 'rmc-date-picker/lib/locale/en_US'
onDateChangeDate change handler.Function(date: moment)''
minuteStepThe amount of time, in minutes, between each minute item. Number1
formatMonthCustomize display value of months(month:number, current:moment) => React.Node
formatDayCustomize display value of days(day:number, current:moment) => React.Node

rmc-date-picker/lib/Popup props

namedescriptiontypedefault
className(web)additional css class of modal nodeString''
style(web)additional modal styleobject{}
popupTransitionName(web)String
maskTransitionName(web)String
prefixCls(web)popup's prefix classString'rmc-picker-popup'
styles(react-native)PopupPicker's stylesStyleSheet.create
datePickerDatePicker elementReact DatePicker element
dateThe currently selected date.moment
visiblewhether pop picker is visibleBooleanfalse
onChangeexec on okFunction(date: moment)
onVisibleChangecalled when pop picker visible changeFunction
onDismissexec on dismissfunction
okTextok button textstring/React.ReactElement'Ok'
dismissTextdismiss button textstring/React.ReactElement'Dismiss'
titlePopup titlestring/React.ReactElement''

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rmc-date-picker is released under the MIT license.


Comments
Details
Added at: 2017/03/19
Owner: react-component
Category: other
Homepage: https://github.com/react-component/m-date-picker
Downloads last month: 6210
Version: 5.4.1
Compatibility
  •  
  •  

Add to your project

npm i --save rmc-date-picker
yarn add rmc-date-picker