woocommerce/plugins/woocommerce-admin/client/components/calendar
Albert Juhé Lluveras ae8739d63f Add required polyfills so react-dates works in Internet Explorer 11 (https://github.com/woocommerce/woocommerce-admin/pull/356)
react-dates developers recommend using airbnb-browser-shims, but doing some
testing I found loading the required polyfills individually instead of the
entire Airbnb Browser Shims package produces smaller builds.
2018-09-11 09:28:50 +02:00
..
README.md Docs Project: Component cleanup (https://github.com/woocommerce/woocommerce-admin/pull/334) 2018-08-31 13:19:13 -04:00
index.js Add required polyfills so react-dates works in Internet Explorer 11 (https://github.com/woocommerce/woocommerce-admin/pull/356) 2018-09-11 09:28:50 +02: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 Merge pull request woocommerce/woocommerce-admin#332 from woocommerce/update/319-datepicker-design-details 2018-08-30 16:33:07 -07:00

README.md

Calendar

This is wrapper for a react-dates powered calendar.

How to use:

import { DateRange } from '@woocommerce/components';

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