getWeeksInMonth
import { getWeeksInMonth } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// How many calendar weeks does February 2015 span?
const result = getWeeksInMonth(new Date(2015, 1, 8))
//=> 4
@example
// If the week starts on Monday,
// how many calendar weeks does July 2017 span?
const result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 })
//=> 6
function getWeeksInMonth<DateType extends Date>(date: DateType | number | string, options?: GetWeeksInMonthOptions): number;
§
getWeeksInMonth<DateType extends Date>(date: DateType | number | string, options?: GetWeeksInMonthOptions): number
[src]§Parameters
§
options?: GetWeeksInMonthOptions optional
[src]- An object with options.