1.0.2 • Published 5 years ago

easy-react-datepicker v1.0.2

Weekly downloads
10
License
MIT
Repository
github
Last release
5 years ago

Easy-React-Datepicker

Reusable React Datepicker component

Installing

Simply install using

npm install easy-react-datepicker --save

This will install the component in your project and add the reference to your package.json

Usage

//Import using
import DatePicker from 'easy-react-datepicker'

state = {
  selectedDate:new Date(),
  dateFormat: 'dddd'
}

//Use the Datepicker as follows
render() {
  return (
    <div>
      <DatePicker selectedDate={new Date(this.state.selectedDate)} />
    </div>
  );
}

Example

Edit easy-react-datepicker

Properties

PropertyDefaultDescription
selectedDatecurrentDateSet the default date
namenullUse the name property if using the datepicker in a form, can be used to retrive the value of datepicker
dateFormatDD/MM/YYYYSet the format of the date in the datepicker input box, refer MomentJS Date Formating

Handlers

EventDescriptionParam
dateSelectedCalled when a new date is selectedReturns the date selected of type Date

Note

  1. The default date need to be passed in the Javascript Date format
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago