react-simple-month-picker
v0.2.3
Published
This is a very light component that makes it possible to select a year and a month and automatically sets the day to the first day of the month then it returns the correspondent Javascript Date Object;
Downloads
78
Maintainers
Readme
Simple Month-Picker For React
This is a very light component that makes it possible to select a year and a month and automatically sets the day to the first day of the month then it returns the correspondent Javascript Date Object;
Presentation
The component's width is responsive, it takes the width of the parent element.
Installation
npm install react-simple-month-picker --save
Example :
import React from 'react';
import ReactDOM from 'react-dom';
import MonthPicker from 'react-simple-month-picker';
ReactDOM.render(<MonthPicker onChange={(date)=>{console.log(date);}} />,
document.getElementById('root')
);
When the user selects a month the value can be retreived by the props function [onChange].
Props:
| Prop | is Required ? | Description | |---|---|---| | function : onChange | false | A callback function that is executed on month selection | | Array: months | false | A JavaScript Array of Strings that must be of length 12, the array represents the months names, by default it's set to ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] |
Issues :
For any suggestion you can open in issue here.
Licence :
MIT