1 var isDate = require('../lang/isDate');
2 var isLeapYear = require('./isLeapYear');
4 var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
7 * returns the total amount of days in the month (considering leap years)
9 function totalDaysInMonth(fullYear, monthIndex){
10 if (isDate(fullYear)) {
11 monthIndex = fullYear.getMonth();
14 if (monthIndex === 1 && isLeapYear(fullYear)) {
17 return DAYS_IN_MONTH[monthIndex];
21 module.exports = totalDaysInMonth;