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