pikaday-react-wrapper
v2.1.6
Published
React component wrapper around Pikaday.js
Downloads
4
Maintainers
Readme
PikadayReactWrapper
Universal React component wrapper around Pikaday.js datepicker. Forked from https://github.com/voronianski/react-pikaday-component and updated for React v16
Install
npm install react pikaday pikaday-react-wrapper --save
Usage
import React from 'react';
import ReactDOM from 'react-dom';
import DatePicker from 'pikaday-react-wrapper';
class App extends React.Component {
constructor() {
super();
this.state = {};
}
onDateChange(date) {
this.setState({ date });
}
render() {
const { date } = this.state;
return (
<div>
<DatePicker
placeholder="Select Date"
format="YYYY/MM/DD"
maxDate={new Date('2020-07-26')}
value={new Date(date)}
onChange={::this.onDateChange}
/>
</div>
);
}
}
ReactDOM.render(
<App />,
document.getElementById('example')
);
Properties
value
onChange
valueLink
tabIndex
- Pikaday configuration options (except
onSelect
andfield
) - other input attributes like
className
,name
,placeholder
,disabled
andreadOnly
MIT Licensed