woocommerce/plugins/woocommerce-admin/client/components/calendar
Paul Sealock 1c447396c8 Datepicker: Custom: Add styles 2018-07-30 10:36:38 +12:00
..
README.md DatePicker: Hook up react-dates 2018-06-27 14:11:13 +12:00
index.js Datepicker: Custom: Add styles 2018-07-30 10:36:38 +12:00
input.js Datepicker: Custom: Add styles 2018-07-30 10:36:38 +12:00
phrases.js Update woo-dash naming to new wc-admin name (https://github.com/woocommerce/woocommerce-admin/pull/183) 2018-07-10 08:48:06 -04:00
style.scss Datepicker: Custom: Add styles 2018-07-30 10:36:38 +12:00

README.md

Calendar

This is wrapper for a react-dates powered calendar.

How to use:

import { DateRange } from 'components/calendar';

render: function() {
  return (
   <DateRangePicker
		start={ moment( 2018-01-01 ) }
		end={ moment( 2020-01-01 ) }
		onSelect={ this.onSelect }
		inValidDays="past"
	/>
  );
}

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