functions for calendar
npm install @share-code/calendar-fns
Check leap year
isLeapYear = (year: number) => boolean
Get anchor day, There are only four case
getAnchorDay = (year: number) => 2 | 0 | 5 | 3
Get the dooms day value using dooms day algorithm
getDoomsDayAlgorithm = (year: number) => number
Get Dooms day of specific month
getDoomsDay = (month: number, year: number) => { day: number, daysOfTheWeek: number }
Get day of the week
0: Sunday
1: Monday
2: Tuesday
3: Wednesday
4: Thursday
5: Friday
6: Saturday
getDayOfWeek = (day: number, month: number, year: number) =>
0 | 1 | 2 | 3 | 4 | 5 | 6
Get length of the month
Possible case : 28, 29, 30, 31
getDaysLengthOfMonth = (month: number, year: number) => 28 | 29 | 30 | 31