Javascript Date getQuarter()

Description

Javascript Date getQuarter()



Date.prototype.getQuarter = function () {
    if (!this.getMonth) return null;
    var m = this.getMonth();
    if (m < 3) return 0;
    if (m < 6) return 1;
    if (m < 9) return 2;
    return 3;//  w ww . j  av a2  s.c o  m
}



PreviousNext

Related