JavaScript

DategetWeeksInYear Method

Syntax

Date.getWeeksInYear()

Returns

weeksnumber

The total number of weeks in the year.

Description

Extension to the native date variable to the get the total number of weeks in the year a given date is in.

Example

var d = new Date(2015,7,10);
var w = d.getWeekOfYear();
// w = 53