MomentJS - Week of year


Advertisements

This method will get/set the week of the year. The output will depend on the locale being used, as first day of week differs from country to country.

Syntax

moment().week(Number);
moment().week();
moment().weeks(Number);
moment().weeks();

Example

var m = moment().week();
var d = moment().week(50);
var a = moment().week(90);

Output

Week of Year
momentjs_getter_setter.htm
Advertisements