1.0.0 • Published 9 years ago
count-days-in-month v1.0.0
count-days-in-month
Get the number of days in a given month
countDaysInMonth(2016, 11); //=> 31
countDaysInMonth(2016, 8); //=> 30Installation
Package managers
npm
npm install count-days-in-monthbower
bower install count-days-in-monthAPI
countDaysInMonth(fullYear, zerBasedMonth)
fullYear: Number of full year, for example 2016
zeroBasedMonth: Number of month, zero based (0, 1, ... 11)
Return: Number of days
It returns a number of days in the month, considering the year is whether a leap year or not.
countDaysInMonth(2015, 1); //=> 28
countDaysInMonth(2016, 1); //=> 29License
Copyright (c) 2016 Shinnosuke Watanabe
Licensed under the MIT License.