Skip to content

Get the number of days in a given month

License

Notifications You must be signed in to change notification settings

shinnn/count-days-in-month

Repository files navigation

count-days-in-month

NPM version Bower version Build Status Coverage Status Dependency Status devDependency Status

Get the number of days in a given month

countDaysInMonth(2016, 11); //=> 31
countDaysInMonth(2016, 8); //=> 30

Installation

npm install count-days-in-month
bower install count-days-in-month

API

countDaysInMonth(fullYear, zeroBasedMonth)

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); //=> 29

License

Copyright (c) 2016 Shinnosuke Watanabe

Licensed under the MIT License.

About

Get the number of days in a given month

Resources

License

Stars

Watchers

Forks

Packages

No packages published