woocommerce/plugins/woocommerce-admin/client/components/calendar/README.md

29 lines
786 B
Markdown
Raw Normal View History

2018-05-28 10:55:19 +00:00
Calendar
============
This is wrapper for a [react-dates](https://github.com/airbnb/react-dates) powered calendar.
## How to use:
```jsx
import { DateRange } from '@woocommerce/components';
2018-05-28 10:55:19 +00:00
render: function() {
return (
<DateRangePicker
start={ moment( 2018-01-01 ) }
end={ moment( 2020-01-01 ) }
onSelect={ this.onSelect }
invalidDays="past"
2018-05-28 10:55:19 +00:00
/>
);
}
```
## Props
* `start`: A moment date object representing the selected start. `null` for no selection
* `end`: A moment date object representing the selected end. `null` for no selection
* `onSelect`: A function called upon selection of a date
* `invalidDays`: Optionally invalidate certain days. `past`, `future`, `none`, or function are accepted. A function will be passed to react-dates' `isOutsideRange` prop