Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
date: DateType | number | string
[src]
  • The given date
§
options?: GetWeeksInMonthOptions optional
[src]
  • An object with options.

§Return Type

§
number
[src]

The number of calendar weeks