string[] | Date[]
Get all dates from a month and some previous and next month dates for covering start and end of the week, grouped by week
import { getAllDatesMatrix } from '@calendar-fp/calendar-fp'
console.log(getAllDatesMatrix(new Date(2021, 0, 1)))
[
[
new Date(2020, 11, 27),
new Date(2020, 11, 28),
new Date(2020, 11, 29),
...
],
[
...
]
...
]
Date[]
Get days of the week
import { getDays } from '@calendar-fp/calendar-fp'
console.log(getDays())
// => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
Optional day formatting
string[]
Get month and year name for calendar navigation
import { getMonthAndYear } from '@calendar-fp/calendar-fp'
console.log(getMonthAndYear(new Date(2021, 2, 1)))
// => March, 2021
Current month as a Date object.
Optional date format
string
Get next month from a date
import { getNextMonth } from '@calendar-fp/calendar-fp'
console.log(getNextMonth(new Date(2021, 2, 1)))
// => new Date(2021, 3, 1)
Current month as a Date object.
Date
Get previous month from a date
import { getPrevMonth } from '@calendar-fp/calendar-fp'
console.log(getPrevMonth(new Date(2021, 2, 1)))
// => new Date(2021, 1, 1)
Current month as a Date object.
Date
Generated using TypeDoc
Get all dates from a month and some previous and next month dates for covering start and end of the week
Example
import { getAllDates } from '@calendar-fp/calendar-fp' console.log(getAllDates(new Date(2021, 0, 1))) // => [new Date(2020, 11, 27), // new Date(2020, 11, 28), // new Date(2020, 11, 29), ...]