input-moment
Version:
React datetime picker powered by momentjs
43 lines (33 loc) • 1.3 kB
Markdown
[](https://www.npmjs.com/package/input-moment)
[](https://travis-ci.org/wangzuo/input-moment)
[](https://github.com/prettier/prettier)
React datetime picker powered by [momentjs](http://momentjs.com)
The design is from https://dribbble.com/shots/1439965-Due-Date-and-Time-Picker.
The icon is from [ionicons](http://ionicons.com/).
``` sh
npm i input-moment --save
```
**Notice:** This module requires [moment](https://www.npmjs.com/package/moment) as a [peerDependency](https://docs.npmjs.com/files/package.json#peerdependencies).
http://wangzuo.github.io/input-moment
``` javascript
<InputMoment
moment={this.state.moment}
onChange={this.handleChange}
onSave={this.handleSave}
minStep={1} // default
hourStep={1} // default
prevMonthIcon="ion-ios-arrow-left" // default
nextMonthIcon="ion-ios-arrow-right" // default
/>
```
Check [app.js](https://github.com/wangzuo/input-moment/blob/master/example/app.js) for a working example.
- npm install
- npm start
- http://localhost:8080
ISC