https://github.com/cheekujha/react-inline-date
https://github.com/cheekujha/react-inline-date
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cheekujha/react-inline-date
- Owner: cheekujha
- Created: 2018-04-07T10:37:18.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-08T10:42:37.000Z (about 7 years ago)
- Last Synced: 2025-03-09T04:35:53.386Z (3 months ago)
- Language: JavaScript
- Size: 168 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-inline-date
> React Date Input Component.
## Demo
[https://cheekujha.github.io/react-inline-date/](https://cheekujha.github.io/react-inline-date/)
## Install
You need to have react and react-dom as dependencies in your project.1. With [npm](https://npmjs.org/) installed, run
```
$ npm install react-inline-date --save
```2. At this point you can import react-inline-date in your application as follows:
```js
import DateInput from 'react-inline-date';```
## Usage
1. Wrap header columns (th / td) with TableFilter as shown below.
```
import React from 'react';
import DateInput,{TYPE_DATE} from 'react-inline-date';class Example extends React.Component {
constructor (props) {
super(props)
this.state = {
startDate: undefined
};
this.handleChange = this.handleChange.bind(this);
}handleChange(timestamp) {
this.setState({
startDate: timestamp
});
}render() {
return ;
}
}
```
## API### Properties
#### DateInput
Name | Type | Default | Required | Description
:--- | :--- | :------ | :------- | :----------
type | String | 'date' | true | Can be one of ['date', 'datetime', 'time']
value | Timestamp | undefined | false | Initial Value
onCommit | function(timestamp, event) | | true | Function called when a date is selected
maxOffset | Timestamp | | false | Date Upper limit
minOffset | Timestamp | | false | Date Lower Limit## License
MIT