getWeekOfMonth

Modified on Tue, 22 Aug 2023

Description

Use this function to get the week of the month of the given date.

Syntax

getWeekOfMonth(date):number

Returns

Return ValueDescription
NumberReturns the week of the month of the given date.

Sample

ExampleResultDescription
getWeekOfMonth(2023-04-08)2The function calculates the week of the month of the given date, which is 2, and returns it.

To view all the Date functions, click here.

See Also