0.1.4 • Published 1 year ago

react-calendar-control v0.1.4

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

react-calendar-control

react-calendar-control for your react projects. Very customizable!

Installation

npm install --save react-calendar-control

Usage

import React, { useState } from 'react'
import { Calendar } from 'react-calendar-control'

const App = () => {
    const [value, onChange] = useState(new Date());  

    return <Calendar onChange={onChange} value={value} isRange />
}

Props

Prop nameDescriptionTypeDefault valueExample values
isRangeWhether the user shall select two dates forming a range instead of one. Note. This feature will make React-Calendar-Control return an array with two datesbooleanfalsetrue
onChangeFunction called when the user clicks an item (day on month view)functionn/a(value) => console.log(value)
valueCalendar value. Can be either one value or an array of two values.new Date()nullDate: new Date() An array of dates: new Date(2020, 0, 1), new Date(2020, 7, 1)