UNPKG
is-valid-month
Version:
latest (1.0.0)
1.0.0
Check if a number is a valid month
github.com/bendrucker/is-valid-month
bendrucker/is-valid-month
is-valid-month
/
index.js
9 lines
(6 loc)
•
206 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
'use strict'
var
isInteger =
require
(
'is-integer'
)
module
.
exports
=
function
isValidMonth
(
month
) {
if
(
typeof
month !==
'number'
|| !
isInteger
(month))
return
false
return
month >=
1
&& month <=
12
}