Sha256: 7e34c4941362aa6e689d0e24e0e1846d62159baf707e08613774a8fb27af839f

Contents?: true

Size: 648 Bytes

Versions: 7

Compression:

Stored size: 648 Bytes

Contents

define(['../lang/isDate', './isLeapYear'], function (isDate, isLeapYear) {

    var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

    /**
     * returns the total amount of days in the month (considering leap years)
     */
    function totalDaysInMonth(fullYear, monthIndex){
        if (isDate(fullYear)) {
            var date = fullYear;
            year = date.getFullYear();
            monthIndex = date.getMonth();
        }

        if (monthIndex === 1 && isLeapYear(fullYear)) {
            return 29;
        } else {
            return DAYS_IN_MONTH[monthIndex];
        }
    }

    return totalDaysInMonth;

});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/mout/src/date/totalDaysInMonth.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/mout/src/date/totalDaysInMonth.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/mout/src/date/totalDaysInMonth.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/mout/src/date/totalDaysInMonth.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/mout/src/date/totalDaysInMonth.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/mout/src/date/totalDaysInMonth.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/mout/src/date/totalDaysInMonth.js