1.0.3 • Published 5 years ago
yac-calendar v1.0.3
yac-calendar
Calendar component written in react and typescript
Install
npm install --save yac-calendaror
yarn add yac-calendarPreview

Usage
import React, { Component } from 'react'
import Calendar from 'yac-calendar'
import 'yac-calendar/dist/index.css'
class Example extends Component {
render() {
return (
<Calendar
date={new Date()}
timeRange={{
start: new Date(2021, 2, 24),
end: new Date(2021, 2, 26)
}}
onSelectRange={(start, end) => console.info('Selected:', start, end)}
/>
)
}
}Props:
date => First date to show (this will select the first month)
timeRange => Start and End date for the selection (optional)
onSelectRange => callback after new range selected on the calendar.
useDoubleMonths => Will show the component as 2 months calendar.
License
MIT © Riccardo Rizzo - riccione83