项目作者: jayeshkattar

项目描述 :
Twelve months calendar component in React JS
高级语言: TypeScript
项目地址: git://github.com/jayeshkattar/react-full-year-calendar.git
创建时间: 2021-03-22T12:22:43Z
项目社区:https://github.com/jayeshkattar/react-full-year-calendar

开源协议:MIT License

下载


npm version
Code Quality: Javascript
Downloads
Total Alerts

react-full-year-calendar

Twelve months calendar component in React JS

Demo

Visit this link

Documentation

Installation

npm

  1. npm install react-full-year-calendar --save

yarn

  1. yarn add react-full-year-calendar

Props

react-full-year-calendar component accepts the below as props

  • year (Mandatory) - Number - Accepts the Year to be displayed
  • onSelection (Optional) - Callback Function - returns the selected Date in String Format (YYYY-MM-DD)
  • numberOfMonths (Optional) - Number - Accepts the number of months to be displayed from the current Month
  • showYearHeading (Optional) - Boolean - Flag to display the year by default it’s false
  • isWeekDay (Optional) - Callback Function - returns a boolean value
  • selectedDates (Optional) - string Array - accepts strings in YYYY-MM-DD format

Example 1

  1. import Calendar from 'react-full-year-calendar';
  2. export default function SimpleCalendar() {
  3. return <Calendar year={2021} ></Calendar>;
  4. }

Example 2

  1. import Calendar from 'react-full-year-calendar';
  2. export default function SimpleCalendar() {
  3. const [current, setCurrent] = useState('');
  4. return <Calendar year={2021} onSelection={setCurrent} ></Calendar>;
  5. }

Example 3

  1. import Calendar from 'react-full-year-calendar';
  2. export default function SimpleCalendar() {
  3. const [weekDay, setWeekDay] = useState(false);
  4. return <Calendar year={2021} isWeekDay={setWeekDay} ></Calendar>;
  5. }