首页 > Web开发 > 详细

js 得到当前季度

时间:2016-01-11 16:30:37      阅读:147      评论:0      收藏:0      [点我收藏+]
 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(); 

js 得到当前季度

原文:http://www.cnblogs.com/baib/p/5121619.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!