is-birthday
given birthdate checks if today is a birthday
is-birthday
takes in a date formatted as a string and returns true if it is a birthday on that date.
Install
$ npm install is-birthday
Usage
const isBirthday = ; // If today is 2020-05-07 // => true // => false // Set a different "today"const options = today: "2020-05-06" // => true
API
isBirthday(birthdate, [options])
Returns true
or false
depending on whether it is a birthday given a birthdate.
birthdate
Type: string
Date, as a string, to check whether it's a birthday or not. Gets converted to
a Date
object.
options
Type: object
today
Type: Date
Default: new Date()
Date to compare birthdate with.
License
MIT © Jan Meppe