JavaScript

DategetWeekOfMonth Method

Syntax

Date.getWeekOfMonth()

Returns

weeknumber

The week of the month.

Description

Extension to the native date variable to the get the week of the month a given date is in. The first of the month will always be in the first week regardless of how many subsequent days are in the same week.

Example

var d = new Date(2018,7,10);
var w = d.getWeekOfMonth();
// w = 2