@codanostra/calendar
v0.1.20
Published
Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.
Downloads
39
Readme
About
A calendar component that provides calendar functionility without any UI parts. Used to create custom calendars.
Installation
yarn add @codanostra/calendar
Basic Usage
...
import Wrapper from '@codanostra/calendar';
return (
<Wrapper>{your components that will use this calendar}</Wrapper>
)
Wrapper sets context around around your component (or part of the code that will display the calendar). So, if you need to have multiple calendars on different places you can use multiple wrappers.
Inside your component you can then call:
// Imports:
import { useMonthController,useWeekController, useSelectedDate } from '@codanostra/calendar';
const {
keys, // return keys for previous, current and next month you can use
monthForward, // function that sets current month to currenthMonth+1
monthBack,// function that sets current month to currenthMonth-1
pagerPosition,
currentMonth,
getByOrder,
nextMonth,
previousMonth,
setCurrentMonth,
setNextMonth,
setPreviousMonth
} = useMonthController();