Here you can find the source of getDaysInMonthOfYear()
Date.prototype.getDaysInMonthOfYear = function(){ month = this.getMonth();/*from www.j a va 2 s.c o m*/ if(month === 1){ return this.isLeapYear()? 29:28; }else{ if(month>=8){ return month%2? 31:30; }else{ return month%2? 31:30; } } }
Date.prototype.getDaysInMonth = function() { return Date.getDaysInMonth(this.getFullYear(), this.getMonth()); };
Date.prototype.getDaysInMonth = function () return Date.getDaysInMonth(this.getFullYear(), this.getMonth()); };
Date.prototype.getDaysInMonth = function () { var m = this.getMonth() + 1, y = this.getFullYear(); return /8|3|5|10/.test(--m) ? 30 : m == 1 ? (!(y % 4) && y % 100) || !(y % 400) ? 29 : 28 : 31; };
Date.getDaysInMonth = function(year, month) { return [ 31, (Date.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ][month]; };
Date.getDaysInMonth = function (year, month) return [31, (Date.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; };