Twelve months calendar component in React JS
Visit this link
npm
npm install react-full-year-calendar --save
yarn
yarn add react-full-year-calendar
react-full-year-calendar component accepts the below as props
year (Mandatory)
- Number - Accepts the Year to be displayedonSelection (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 MonthshowYearHeading (Optional)
- Boolean - Flag to display the year by default it's falseisWeekDay (Optional)
- Callback Function - returns a boolean valueselectedDates (Optional)
- string Array - accepts strings in YYYY-MM-DD format
import Calendar from 'react-full-year-calendar';
export default function SimpleCalendar() {
return <Calendar year={2021} />;
}
import Calendar from 'react-full-year-calendar';
export default function SimpleCalendar() {
const [current, setCurrent] = useState('');
return <Calendar year={2021} onSelection={setCurrent} />;
}
import Calendar from 'react-full-year-calendar';
export default function SimpleCalendar() {
const [weekDay, setWeekDay] = useState(false);
return <Calendar year={2021} isWeekDay={setWeekDay} />;
}