MomentJS - Quarter


Advertisements

This method will get and set the quarter. The range is 1-4. Inputs greater than the range will fall in the next year and less will fall in the previous years.

Syntax

moment().quarter();
moment().quarter(Number);
moment().quarters();
moment().quarters(Number);

Example

var m = moment().quarter();
var d = moment().quarter(3);
var a = moment().quarter(6);
var k = moment().quarter(-1);

Output

Quarter
momentjs_getter_setter.htm
Advertisements