MomentJS - Weeks in year



This method will get the number of weeks according to locale in the current moment's year.

Syntax

moment().weeksInYear();

Example

var m = moment().weeksInYear();

Output

Weeks in Year

Weeks in Year (ISO)

This method will get the number of weeks according to the ISO in the current moment's year.

Syntax

moment().isoWeeksInYear();

Example

var m = moment().isoWeeksInYear();

Output

Weeks in Year ISO
momentjs_getter_setter.htm
Advertisements