js 得到当前季度

 1 Date.prototype.getQuarter = function() {
 2         var month = this.getMonth();
 3         if(month  < 3) {
 4             return ‘第一季度‘;
 5         }else if(month < 6) {
 6             return ‘第二季度‘;
 7         }else if(month <9) {
 8             return ‘第三季度‘;
 9         }else if(month <12) {
10             return ‘第四季度‘;
11         }
12 };

调用方式:

new Date().getQuarter(); 

文章来自:http://www.cnblogs.com/baib/p/5121619.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3