0.1.3 • Published 7 years ago

react-calendar-simple v0.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Simple Calendar For ReactJS

This is a very light component that makes it possible to preview the month days of a given date then it returns the selected day when clicked;

Presentation

The component's width is responsive, it takes the width of the parent element. Image of the month picker

Installation

npm i react-calendar-simple --save

Example :

import React from 'react';
import ReactDOM from 'react-dom';
import Calendar from 'react-calendar-simple';

ReactDOM.render(
    <Calendar 
    focusOnDate={new Date()} 
    onDateSelection={(date)=>{console.log(date)}}/>,
  document.getElementById('root')
);

When the user selects a given date the value can be retreived by the props function onDateSelection.

Props:

Propis Required ?Description
Date : focusOnDatetrueThe initial date value from of the calendar, only the day and the year of the Date Object are important to generate the calendar
Function: onDateSelection(Date)trueA callback function that is executed when a day is selected on the calendar
Array: daysArrayfalseThis is a JavaScript Array that must be of length 7, it represents the 7 days of the week, by default it is set to"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"

Issues :

For any suggestion you can open an issue here.

Licence :

MIT

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago