Skip to main content
Very Popular
Go to Latest
function getWeeksInMonth
import { getWeeksInMonth } from "https://deno.land/x/date_fns@v2.1.0/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