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(); 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM