/react-basic-datepicker

A super-simple date-picker built with React

Primary LanguageJavaScriptMIT LicenseMIT

npm version Travis

React Basic Datepicker

A barebones, super-simple datepicker built with React. This was built to be as simple and small as I could make it, if you want something with a few more features then check out React Datepicker.

Check out the demo

Usage

Render the datepicker and supply any of the props listed below.

ReactDOM.render(<Datepicker dateFormat="DD/MM/YYYY" />, document.getElementById('react-root'));

There are basic styles defined in the demo directory which can be copied into your project.

Props

You can customise the datepicker by supplying the follow props.

  • dateFormat e.g. DD-MM-YYYY
  • startDate e.g. new Date()
  • minDate e.g. new Date(2016, 11)
  • prevButtonLabel e.g. 'Previous Month'
  • nextButtonLabel e.g. 'Next Month'
  • handleDateChange e.g. set state or do whatever with the date...
  • datepickerName e.g. my-date-picker
  • datepickerId e.g. my-date-picker
  • datepickerClassName e.g. my-date-picker