Skip to content

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

Notifications You must be signed in to change notification settings

FrenchTechLead/react-simple-month-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. Image of the month picker

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published