Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
function default
import { default } from "https://deno.land/x/date_fns@v2.0.0-alpha.32/getWeeksInMonth/index.js";

Examples

// How many calendar weeks does February 2015 span? var result = getWeeksInMonth(new Date(2015, 1, 8)) //=> 4

// If the week starts on Monday, // how many calendar weeks does July 2017 span? var result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 }) //=> 6

Parameters

date
  • the given date
options